Re: django-admin.py startproject mysite

2015-11-04 Thread Dheerendra Rathor
Start your site with python manage.py runserver 0.0.0.0:8000 On Thu, 5 Nov 2015 at 11:35 Muhammad Asamov wrote: > HI > I was wodering whether someone can hepl me with startproject > > The thing is when I am running startproject from the server ip > 127.0.0.1:8000 > which was

Re: django-admin.py startproject mysite

2015-11-04 Thread Muhammad Asamov
HI I was wodering whether someone can hepl me with startproject The thing is when I am running startproject from the server ip 127.0.0.1:8000 which was created automaticly i can see the result but if i give different address: 0.0.0.0:8000 I can see nothing it is not showing anything

Re: Login with email address

2015-11-04 Thread Russell Keith-Magee
On Wed, Nov 4, 2015 at 11:58 PM, victor menezes wrote: > I agree that it is time for django to change it (at least making the > changes easier) > I’m intrigued - exactly how much easier do you want us to make it? At this point, it is *literally* installing a third

Re: Error: The response content must be rendered before it can be accessed.

2015-11-04 Thread sonu kumar
I am having different URLs configuration. same view is called for two URLs based on **kwargs decision is made what to do? In one of case I need to get result of all related objects which is tagged with given keyword. I found another way to do achieve same using function based view. On

Re: I'm a Flask/Android developer in need of advice. Is Django a good fit for my next project: a no-transaction marketplace website/mobile app?

2015-11-04 Thread marcin . j . nowak
On Sunday, October 25, 2015 at 5:43:50 PM UTC+1, Kitti Wateesatogkij wrote: > > > I'm interested in django if there's a package that fits my requirements so > I don't have to do it all manually in Flask. If possible please recommend > such packages for me. > > Django will give you more tools

Re: can I write Django a client consuming RESTfull api from elsewhere

2015-11-04 Thread marcin . j . nowak
> > > On Wednesday 04 November 2015 10:43 PM, Avraham Serour wrote: > So I have to use a client connection object such as Python request > So I want to keep it as global, so that all views can access it from a > single location, instead of creating a client request instance for every > view

Re: can I write Django a client consuming RESTfull api from elsewhere

2015-11-04 Thread kk
On Wednesday 04 November 2015 10:43 PM, Avraham Serour wrote: the question is why, why would you want to store a global connection for a REST server? keep in mind that you would be making HTTP requests, meaning even that you had a global variable holding the connection it would just open

GenericIPAddressField validators

2015-11-04 Thread Christophe Collet
Hi all, I just discovered Django and i'm using GenericIPAddressField in my fisrt app. I currently use Django 1.6.11 and i'm facing a problem with ipv6 validator. I ran the following test case: *** from django.utils.ipv6 import is_valid_ipv6_address def check_ipv6_validator(ipv6):

Djangodriven site is slow

2015-11-04 Thread Hooshyar Naraghi
Hi Django users, I am looking for a Django consultant with knowledge in nginx/Gunicorn/Ubuntu server administration skills. If I am in the wrong place, I apologize in advance. I appreciate if you refer me to a venue I could look for Django consultants for hire. A brief description. A

Re: Best practices for writing functional tests to exercise forms?

2015-11-04 Thread Tim Chase
On 2015-11-04 18:39, Gergely Polonkai wrote: > An even more fine grained solution may be using an HTML parser like > beautifulsoup. However, if your site's functionality depends on > client side features like JavaScript, Selenium may be a better > alternative. My code doesn't rely on any

Re: Error: The response content must be rendered before it can be accessed.

2015-11-04 Thread Daniel Roseman
On Wednesday, 4 November 2015 20:51:53 UTC, sonu kumar wrote: > > class based views are as below > > class TagList(TemplateView): > > def get_context_data(self, **kwargs): > > ... > > qlist = QueList.as_view()(self.request, **kwargs) > print qlist > > ... >

Error: The response content must be rendered before it can be accessed.

2015-11-04 Thread sonu kumar
class based views are as below class TagList(TemplateView): def get_context_data(self, **kwargs): ... qlist = QueList.as_view()(self.request, **kwargs) print qlist ... class QueListView(ListView): def get_context_data(self, **kwargs):

Re: Django admin multipleselect filter

2015-11-04 Thread Andreas Kuhne
HI! Thanks for the pointers. I actually was able to solve it by myself. What I did was create a multichoice checkbox field in a form. Then I used a bit of javascript just to reformat the parameters in a way that I wanted then. Works very good actually. :-) Med vänliga hälsningar, Andréas Kühne

redirect to change form page from admin action intermediate page

2015-11-04 Thread dc
I am trying to add admin action 'download_selected'. When the action is selected, it redirects to an intermediate page. When the user selects a file type and clicks on 'download', it downloads the file and stays on that page. How do I redirect it back to change form page it happens for

Re: How do I relate two tables using field name instead of id?

2015-11-04 Thread Gergely Polonkai
This really depends on the structure of your models. In this case you will most likely have a ForeignKey in one of your models; if the referenced model has an __str__() method, the admin site (and also any other forms) will display names instead of the text "OtherModel object". On 4 Nov 2015

Re: Best practices for writing functional tests to exercise forms?

2015-11-04 Thread Gergely Polonkai
An even more fine grained solution may be using an HTML parser like beautifulsoup. However, if your site's functionality depends on client side features like JavaScript, Selenium may be a better alternative. On 4 Nov 2015 18:33, "Dheerendra Rathor" wrote: > You can use

Re: How do I relate two tables using field name instead of id?

2015-11-04 Thread Dheerendra Rathor
In your model use define __str__ method to name1. Then django admin will use name1 in dropdown box. On Wed, 4 Nov 2015 at 21:50 frocco wrote: > Hello, > > I have two existing tables > table1 has name1 > > table2 has name2 > > when I edit table2 in admin, I want a dropdownbox

Re: Best practices for writing functional tests to exercise forms?

2015-11-04 Thread Dheerendra Rathor
You can use unittest.TestCase.assertRegexpMatches for checking if form is present in rendered template. If you want to check the entire cycle (form loading, filling) you can use selenium for testing on live server. On Wed, 4 Nov 2015 at 22:08 Tim Chase wrote: >

Re: can I write Django a client consuming RESTfull api from elsewhere

2015-11-04 Thread Avraham Serour
the question is why, why would you want to store a global connection for a REST server? keep in mind that you would be making HTTP requests, meaning even that you had a global variable holding the connection it would just open and close each tie you make a request. if you need t keep a connection

[ANNOUNCE] Django bugfix release issued: 1.8.6

2015-11-04 Thread Tim Graham
Details are available on the Django project weblog: https://www.djangoproject.com/weblog/2015/nov/04/bugfix-release-issued/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send

Re: can I write Django a client consuming RESTfull api from elsewhere

2015-11-04 Thread Gergely Polonkai
On 4 Nov 2015 17:31, "kk" wrote: > > > Ok one question, > I would like to store a client connection in some kind of a global place for my entire Django frontend. > So that the request object can be used from any view. > Can you suggest some guideline to do this? > Happy

Re: How to clean up character database fields with leading and trailing spaces

2015-11-04 Thread Derek
Lots of ideas here: http://stackoverflow.com/questions/5043012/django-trim-whitespaces-from-charfield On Tuesday, 3 November 2015 16:31:26 UTC+2, DJ-Tom wrote: > > > It worked! Basically it was a one-liner as well :-) > > > -- You received this message because you are subscribed to the Google

Best practices for writing functional tests to exercise forms?

2015-11-04 Thread Tim Chase
Beginning a new project, I'd like to include functional testing in addition to my unit tests. What are recommended best practices for exercising form-classes? I was hoping to do something like c = django.test.Client() results = c.get(page_url) frm = SomeForm() # pseudo-code for desired

Re: Django admin multipleselect filter

2015-11-04 Thread Derek
This project does not seem active, but maybe you could still make use of it: https://github.com/kevwilde/django-adminfilters Otherwise some other suggestions: http://stackoverflow.com/questions/7834990/selecting-multiples-choices-in-django-admin-filter-list-filter On Monday, 2 November 2015

Re: can I write Django a client consuming RESTfull api from elsewhere

2015-11-04 Thread kk
Ok one question, I would like to store a client connection in some kind of a global place for my entire Django frontend. So that the request object can be used from any view. Can you suggest some guideline to do this? Happy hacking. Krishnakant. On Tuesday 03 November 2015 08:35 PM, Remco

Re: Dynamic Formset Radiobutton Issue

2015-11-04 Thread Jur Remeijn
Hi, So I may have judged too fast. Turns out you were pretty close! I saw that the contributors to the plugin used jQuery in their demo project and I tried it as well... And it worked! Thanks for the suggestion! Really helped me out here :) Op zaterdag 24 oktober 2015 20:01:36 UTC+2 schreef

Re: Dynamic Formset Radiobutton Issue

2015-11-04 Thread Jur Remeijn
Hi, So I may have judged too fast. Turns out you were pretty close! I saw that the contributors to the plugin used jQuery in their demo project and I tried it as well... And it worked! Thanks for the suggestion! Really helped me out here :) Op vrijdag 23 oktober 2015 14:54:49 UTC+2 schreef

How do I relate two tables using field name instead of id?

2015-11-04 Thread frocco
Hello, I have two existing tables table1 has name1 table2 has name2 when I edit table2 in admin, I want a dropdownbox that shows values from table1 using name1 both fields are character I cannot change the design, porting from msaccess thanks -- You received this message because you are

Re: Form to login

2015-11-04 Thread victor menezes
Looks like you are not making anything very custom on you view so maybe would be easier/better to use the buitin views from django auth. on your urls.py you can do: from django.contrib.auth import views as auth_views urlpatterns = [ ... url(r'^login/', auth_views.login), ] On your

Re: Login with email address

2015-11-04 Thread victor menezes
I agree that it is time for django to change it (at least making the changes easier). On my project I did create a new user model that inherit from AbstractUser class UserManager(BaseUserManager): ... class User(AbstractBaseUser): email = models.EmailField(unique=True) objects = UserManager()

Re: Dynamic Formset Radiobutton Issue

2015-11-04 Thread Jur Remeijn
Hello Collin, Thanks for your reply! I tried using jQuery 1.2.6. but it sadly didn't help my problem. Since the plugin is still updated regularly, I think using the newest jQuery plugin shouldn't be a problem. The weird thing is, today I was playing around with the problem, and it turns out that

Re: Authenticate users with both username and email

2015-11-04 Thread Russell Keith-Magee
Yes, there *is* a very simple way to implement “Email address as username” - you use a custom user model that implements that approach. https://docs.djangoproject.com/en/1.8/topics/auth/customizing/#substituting-a-custom-user-model Django’s docs contain details of how to do this, and there are

Re: Login with email address

2015-11-04 Thread Chesco Igual
Hi Patrick, I used emails "as usernames" many times in my projects. You can use django-authtools (https://github.com/fusionbox/django-authtools), it has an AbstractEmailUser (https://django-authtools.readthedocs.org/en/latest/intro.html#authtools.models.AbstractEmailUser). You can set your

Custom QuerySet and __date field lookup

2015-11-04 Thread aprzywecki
Hello, I'm playing around with the 1.9 beta release. The __date field lookup (casts DateTimeField to a date) is a very useful new addition. However, it doesn't seem to work in a custom QuerySet. models.py class EntryQuerySet(models.QuerySet): def today(self): today = now().date()

Re: How do I let forms.models.ModelChoiceField.queryset relate on request.user?

2015-11-04 Thread Axel Rau
Thanks, I will try this, Axel > Am 02.11.2015 um 13:50 schrieb Vijay Khemlani : > > At least what I do in those cases is to add a constructor (__init__) to the > form class which takes the user as a parameter, modify the choicefield > queryset, and then call the original

Re: Login with email address

2015-11-04 Thread Dheerendra Rathor
By default emails are not unique in Django. There are several approaches you can use: 1. In your login view use email to fetch user and then call authenticate for username. For signup you can use any garbage username! 2. Write custom user model (Just extend User model and change USERNAME_FIELD to

Login with email address

2015-11-04 Thread Patrick Breitenbach
Is there a current "best" approach or module for signup/login with an email address? I can't believe this is not included with django. In fact, it should be the default. 80-99% of services and projects do not use usernames. -- You received this message because you are subscribed to the Google

Re: Authenticate users with both username and email

2015-11-04 Thread Patrick Breitenbach
Are you suggesting that there's a relatively easy way to implement "email address as username"? Is it as easy as just putting an email address into the username field? And making sure to update it when someone updates their email address? On Monday, January 19, 2015 at 2:33:35 AM UTC-8, James