Django doesn't touch tables that already exists in database.
So if you had model Poll run syncdb and then change, add or remove fields Django doesn't modify underlying table.
There is few options that resolves your problem: - Manually migrate your database using plain SQL. - Recreate table or whole database. - Use south for database migrations. 6.2.2013 12:08, Avnesh Shakya kirjoitti:
thanks alot....... but i have set it but again it's showing new error...... like... C:\mysite>python manage.py shell Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from polls.models import Poll,Choice >>> Poll.objects.all() Traceback (most recent call last): File "<console>", line 1, in <module> File "C:\Python27\lib\site-packages\django\db\models\query.py", line 72, in __repr__ data = list(self[:REPR_OUTPUT_SIZE + 1]) File "C:\Python27\lib\site-packages\django\db\models\query.py", line 87, in __len__ self._result_cache.extend(self._iter) File "C:\Python27\lib\site-packages\django\db\models\query.py", line 291, in iterator for row in compiler.results_iter(): File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", line 763, in results_iter for rows in self.execute_sql(MULTI): File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", line 818, in execute_sql cursor.execute(sql, params) File "C:\Python27\lib\site-packages\django\db\backends\util.py", line 40, in execute return self.cursor.execute(sql, params) File "C:\Python27\lib\site-packages\django\db\backends\sqlite3\base.py", line 344, in execute return Database.Cursor.execute(self, query, params) DatabaseError: no such column: polls_poll.pub_date >>> On Wed, Feb 6, 2013 at 2:49 PM, Jani Tiainen <rede...@gmail.com <mailto:rede...@gmail.com>> wrote: Now look your Poll model and try to find field "pub_date" there... :) 6.2.2013 11:03, Avnesh Shakya kirjoitti: thanks.. i have added my polls.models file On Wed, Feb 6, 2013 at 2:20 PM, Sergiy Khohlov <skhoh...@gmail.com <mailto:skhoh...@gmail.com> <mailto:skhoh...@gmail.com <mailto:skhoh...@gmail.com>>> wrote: 1) please provide your model Poll 2) are you run syncdb ? Many thanks, Serge +380 636150445 skype: skhohlov 2013/2/6 Avnesh Shakya <avnesh.n...@gmail.com <mailto:avnesh.n...@gmail.com> <mailto:avnesh.n...@gmail.com <mailto:avnesh.n...@gmail.com>>__>: > > Here i want to explore database API.... but it's generating error...... > C:\mysite>python manage.py shell > Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > (InteractiveConsole) >>>> from polls.models import Poll,Choice >>>> Poll.objects.all() > [] >>>> import django >>>> from django.utils import timezone >>>> p= Poll(question="what's new?",pub_date= timezone.now()) > Traceback (most recent call last): > File "<console>", line 1, in <module> > File "C:\Python27\lib\site-__packages\django\db\models\__base.py", line 367, > in __init__ > raise TypeError("'%s' is an invalid keyword argument for this function" > % kwargs.keys()[0]) > TypeError: 'pub_date' is an invalid keyword argument for this function >>>> > > -- > 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+unsubscribe@__googlegroups.com <mailto:django-users%2bunsubscr...@googlegroups.com> <mailto:django-users%__2bunsubscr...@googlegroups.com <mailto:django-users%252bunsubscr...@googlegroups.com>__>. > To post to this group, send email to django-users@googlegroups.com <mailto:django-users@googlegroups.com> <mailto:django-users@__googlegroups.com <mailto:django-users@googlegroups.com>>. > Visit this group at http://groups.google.com/__group/django-users?hl=en <http://groups.google.com/group/django-users?hl=en>. > For more options, visit https://groups.google.com/__groups/opt_out <https://groups.google.com/groups/opt_out>. > > -- 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+unsubscribe@__googlegroups.com <mailto:django-users%2bunsubscr...@googlegroups.com> <mailto:django-users%__2bunsubscr...@googlegroups.com <mailto:django-users%252bunsubscr...@googlegroups.com>__>. To post to this group, send email to django-users@googlegroups.com <mailto:django-users@googlegroups.com> <mailto:django-users@__googlegroups.com <mailto:django-users@googlegroups.com>>. Visit this group at http://groups.google.com/__group/django-users?hl=en <http://groups.google.com/group/django-users?hl=en>. For more options, visit https://groups.google.com/__groups/opt_out <https://groups.google.com/groups/opt_out>. -- 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+unsubscribe@__googlegroups.com <mailto:django-users%2bunsubscr...@googlegroups.com>. To post to this group, send email to django-users@googlegroups.com <mailto:django-users@googlegroups.com>. Visit this group at http://groups.google.com/__group/django-users?hl=en <http://groups.google.com/group/django-users?hl=en>. For more options, visit https://groups.google.com/__groups/opt_out <https://groups.google.com/groups/opt_out>. -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- 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+unsubscribe@__googlegroups.com <mailto:django-users%2bunsubscr...@googlegroups.com>. To post to this group, send email to django-users@googlegroups.com <mailto:django-users@googlegroups.com>. Visit this group at http://groups.google.com/__group/django-users?hl=en <http://groups.google.com/group/django-users?hl=en>. For more options, visit https://groups.google.com/__groups/opt_out <https://groups.google.com/groups/opt_out>. -- 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.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
-- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- 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.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.