Re: handling IntegrityError: Duplicate entry in UserCreationForm

2013-04-25 Thread Siddharth Ghumre
hi Sachin, Please use django's form clean method in order to validate your phone_num field. You can also override the django's clean method by using your own clean_phone_field method. Please refer the link:- https://docs.djangoproject.com/en/dev/ref/forms/validation/ I am sure that a small googl

Re: django development server timeout too quick

2013-04-25 Thread Siddharth Ghumre
Hi Hadi, I am using sessions.middleware.SessionIdleTimeout in my app which takes care of the session management https://pypi.python.org/pypi/django-session-idle-timeout/1.0.1 Its clean and easy way to handle session timeouts. -Siddharth On Wed, Apr 24, 2013 at 11:57 AM, Hadi Sunyoto wrote:

Re: handling IntegrityError: Duplicate entry in UserCreationForm

2013-04-25 Thread Pradeep Kumar
Hi Sachin, If you have added the unique=True later and migrated the existing table, I would also suggest you to first clean up the NULL and duplicate entries using a script or even from shell. After doing that you can use * try: * # your code here * except IntegrityError: * #create v

Re: handling IntegrityError: Duplicate entry in UserCreationForm

2013-04-25 Thread isachin
Thanx Siddharth and Pradeep, I will try both suggestion and let you know On Thu, Apr 25, 2013 at 2:07 PM, Pradeep Kumar wrote: > Hi Sachin, > > If you have added the unique=True later and migrated the existing table, I > would also suggest you to first clean up the NULL and duplicate entries >

cant syncdb with postgresql

2013-04-25 Thread Pedro Silva
I cant sync db with heroku postgresql, with sqllite works great. Can anybody help me? requeriments: Django==1.4.5 PIL==1.1.7 distribute==0.6.36 dj-database-url==0.2.1 django-db-log==2.2.1 django-log-file-viewer==0.4 psycopg2==2.5 virtualenv==1.9.1 erro: c:\WorkspacePY>python manage.py reset meet

Re: cant syncdb with postgresql

2013-04-25 Thread Timothy Makobu
You need to catch exceptions during a commit and rollback the incomplete transaction. from django.db import connection connection._rollback() to rollback the current one. On Thu, Apr 25, 2013 at 4:08 PM, Pedro Silva wrote: > I cant sync db with heroku postgresql, with sqllite works great. > Ca

Re: handling IntegrityError: Duplicate entry in UserCreationForm

2013-04-25 Thread Kelly Nicholes
If you ever want to know how the UserCreationForm works, the source is always available not only on your machine but also on https://github.com/django/django/blob/master/django/contrib/auth/models.py On Wednesday, April 24, 2013 9:27:39 AM UTC-6, sachin wrote: > > Hello, > > I m extending my au

Re: cant syncdb with postgresql

2013-04-25 Thread Pedro Silva
no lock with that -- 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 an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@go

ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing

2013-04-25 Thread Iftikhar Ali
when i am running the project it is running perfectly fine but when i am trying to open django-admin.py shell the error: ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.con

Re: I encountered a core exception and need help configuring for a database. My OS is Ubuntu 12.10 32 bit

2013-04-25 Thread Iftikhar Ali
> > buddy i am also getting the same error... if you have so far got the > answer please help me too... > -- 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 an email to djan

Re: cant syncdb with postgresql

2013-04-25 Thread Daniele Procida
On Thu, Apr 25, 2013, Pedro Silva wrote: >I cant sync db with heroku postgresql, with sqllite works great. >Can anybody help me? >requeriments: >Django==1.4.5 >PIL==1.1.7 >distribute==0.6.36 >dj-database-url==0.2.1 >django-db-log==2.2.1 >django-log-file-viewer==0.4 >psycopg2==2.5 >virtualenv==1.9

Re: I encountered a core exception and need help configuring for a database. My OS is Ubuntu 12.10 32 bit

2013-04-25 Thread C. Kirby
Can you show the file structure of you project like this: /project -app1/ --models.py --views.py -manage.py -settings.py with your actual files and structure? Also it would be useful to see the contents of you manage.py file On Friday, March 22, 2013 12:54:58 AM UTC-5, Lightning wrote: > > CORRE

Re: ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before access

2013-04-25 Thread Tom Evans
On Thu, Apr 25, 2013 at 2:56 PM, Iftikhar Ali wrote: > when i am running the project it is running perfectly fine but when i am > trying to open django-admin.py shell the error: Don;t use django-admin to launch the shell, only use django-admin to create projects¹. Once you have created your proje

Re: Calling Jquery or javascript function based on an if condition

2013-04-25 Thread Iftikhar Ali
yes brother you can it is very easy just put your condition in and if you should have to know how the if condition is working in django templates {% ifequals comparator1 comparator2 %} call javascript function from here {% end ifequals %} -- You received this message because you are subscrib

Re: ManyToMany relationship and raw sql queries

2013-04-25 Thread Matthieu Bouron
On Thursday, April 11, 2013 5:39:57 PM UTC+2, Tom Evans wrote: > > On Thu, Apr 11, 2013 at 3:42 PM, Matthieu Bouron > > wrote: > > Hello, > > > > Is there a way to handle many-to-many relationship with raw sql queries > ? > > I have the following model: > > > > from django.db import models

Re: cant syncdb with postgresql

2013-04-25 Thread Pedro Silva
installed apps: 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', 'django.contrib.admindocs', 'psycopg2.extensions', #my app 'meetpop.meet', #m

Re: Django 1.5.1 and formsets with more than 1000 initials

2013-04-25 Thread Carsten Fuchs
Hi Xavier, thank you very much for your reply! :) Am 25.04.2013 07:31, schrieb Xavier Ordoquy: I'm not sure whether the FormSet could extends itself this number if the initial_data is larger than 1000. If I understand the documentation correctly, the purpose of the `max_num` parameter is t

Re: cant syncdb with postgresql

2013-04-25 Thread Pedro Silva
no luck with that Quinta-feira, 25 de Abril de 2013 14:27:31 UTC+1, Timothy Makobu escreveu: > > You need to catch exceptions during a commit and rollback the incomplete > transaction. > > from django.db import connection > connection._rollback() > > to rollback the current one. > > > On Thu, Apr

Re: cant syncdb with postgresql

2013-04-25 Thread Daniele Procida
On Thu, Apr 25, 2013, Pedro Silva wrote: >installed apps: >'django.contrib.auth', >'django.contrib.contenttypes', >'django.contrib.sessions', >'django.contrib.messages', >'django.contrib.staticfiles', >'django.contrib.admin', >'django.contrib.admindocs', >'psycopg2

Re: cant syncdb with postgresql

2013-04-25 Thread Tom Evans
On Thu, Apr 25, 2013 at 3:59 PM, Pedro Silva wrote: > installed apps: > 'django.contrib.auth', > 'django.contrib.contenttypes', > 'django.contrib.sessions', > 'django.contrib.messages', > 'django.contrib.staticfiles', > 'django.contrib.admin', > 'django.contrib.admindoc

Re: Problem with creating a one-to-one instance

2013-04-25 Thread Carsten Fuchs
Hi all, Am 16.04.2013 17:50, schrieb Carsten Fuchs: I'm probably overlooking something very simple, but still cannot explain what the code below does wrong: [...] >>> ma = Mitarbeiter.objects.get(key="F426") >>> ma.vbp # ok, initially "None" >>> ma.vbp = Vorb

Re: Problem with creating a one-to-one instance

2013-04-25 Thread Tom Evans
On Thu, Apr 25, 2013 at 4:55 PM, Carsten Fuchs wrote: > Hi all, > […] > In the example that works (in my original mail, not quoted here), when the > assignment is done, the Vorblendplan instance already has an id, so that it > is properly carried into ma.vbp_id. > > Can someone confirm this, is my

Running into Unicode Decode Error when using django-admin.py startproject.

2013-04-25 Thread Eric Nielsen
I am brand new to Django and I am having a big problem right off the bat. I cannot use startproject to begin my web app. When I use this command: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/bin/django-admin.py startproject cms I get this error: "Unic

Unexpected Server Error (500) in tutorial

2013-04-25 Thread dsmakearney
I am running python 3.3.1, django-dev, Windows 7, dev version of tutorial part 3 - Customizing Error Views The 404 (page not found) view The suggested code works as expected though I have some quibbles about documentation wording. BUT... When in settings.py DEBUG= True, django prin

Re: Unexpected Server Error (500) in tutorial

2013-04-25 Thread C. Kirby
Django 1.5 made a change with https://docs.djangoproject.com/en/1.5/releases/1.5/#allowed-hosts-required-in-production "The new ALLOWED_HOSTSsetting validates the request’s Host header and protects against host-pois

Re: Problem with creating a one-to-one instance

2013-04-25 Thread Carsten Fuchs
Hi Tom, Am 2013-04-25 18:53, schrieb Tom Evans: Yes, this is correct, when you assign an object to a foreign key, it must already be saved so that it has an id in order to persist in the database. It's very good to hear this, thank you very much for your reply! In 1.4, the check is not prese

How can I divide a page into multiple parts using multiple html files and django templates?

2013-04-25 Thread bilgehan . balban
Hi, I want to divide a page into parts, such as sidenav.html, topnav.html and so on such that the base.html is not cluttered with details of the complex topnav or sidebar. Problem is Django template inheritence can only have one to one parent child relationship and I cannot have multiple html c

Re: How can I divide a page into multiple parts using multiple html files and django templates?

2013-04-25 Thread Nikolas Stevenson-Molnar
The include would probably help you here: https://docs.djangoproject.com/en/1.5/ref/templates/builtins/#include _Nik On 4/25/2013 11:56 AM, bilgehan.bal...@gmail.com wrote: > Hi, > > I want to divide a page into parts, such as sidenav.html, topnav.html > and so on such that the base.html is not c

Re: cant syncdb with postgresql

2013-04-25 Thread Pedro Silva
i already try it, no success, i think app its fine, its something with postgresql... 2 days ago i was able to sync, create.. db since yesterday its jus give that msg. i already uninstall python and django, reinstall and get same erro. Still works fine with sqlite3, when i change the db... fails

Re: Unexpected Server Error (500) in tutorial

2013-04-25 Thread dsmakearney
Thanks. -- 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 an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups

Re: Unexpected Server Error (500) in tutorial

2013-04-25 Thread dsmakearney
That probably means the tutorial can't really demonstrate 404.html, 500.html, or 403.html customization. On Thursday, April 25, 2013 6:24:37 PM UTC-4, dsmak...@gmail.com wrote: > > Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: Unexpected Server Error (500) in tutorial

2013-04-25 Thread Mike Dewhirst
On 26/04/2013 8:32am, dsmakear...@gmail.com wrote: That probably means the tutorial can't really demonstrate 404.html, 500.html, or 403.html customization. If you are getting 500 errors you should be able to see your own 500.html displayed. On Thursday, April 25, 2013 6:24:37 PM UTC-4

Re: How can I divide a page into multiple parts using multiple html files and django templates?

2013-04-25 Thread bilgehan . balban
Let us assume that I have 5 files like this that are included by base.html via "include". How would I then extend each of those? Looks like once you include a couple pages, you have no way of extending them each, because you have to render one child template. Perhaps the best practice is to mix

Re: Unexpected Server Error (500) in tutorial

2013-04-25 Thread Mike Dewhirst
On 26/04/2013 3:41am, dsmakear...@gmail.com wrote: I am running python 3.3.1, django-dev, Windows 7, When I Set DEBUG=False, I then get "Server Error (500)" not 404. With some experimentation, I discovered that if I set DEBUG=False the tutorial app appears to always fail with Server Error 5

Re: How can I divide a page into multiple parts using multiple html files and django templates?

2013-04-25 Thread Nikolas Stevenson-Molnar
I'm not sure I understand your end goal. You /can/ extend your includes, you'd just include the extended template. E.g.: sidenav_base.html sidenav_specific.html {% extends "sidenav_base.html" %} base.html {% include "sidenav_specific.html" %} Or if you're then extending base.html and want a d

How can I completely remove Django and reinstall it - I've broken something

2013-04-25 Thread Garry Pettet
I'm a complete newcomer to Python and the Django framework so please be gentle. I'm on a Mac 10.8 and MAMP. I was following the tutorial and installed the latest stable version (1.5) of Django using pip thanks to the instructions on this page

Re: Getting error on first step of tutorial

2013-04-25 Thread A. Dias
Hey Dennis! Have you figured out an answer for that one yet? cause i'm dealing with the exact same error and it would be great if you had a solution for it! Cheers, Alex Terça-feira, 9 de Abril de 2013 7:03:28 UTC+1, mill...@telusplanet.net escreveu: > > I'm new to web frameworks and am tryin

Re: ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before access

2013-04-25 Thread Iftikhar Ali
> but while testing and pychecker i am getting this error how should i > configure DJANGO_SETTINGS_MODULE > -- 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 an email t