locoboy
locoboy

Reputation: 38940

Django admin problems

I have the following stack trace when trying to access the django admin default app. Does anyone know how to fix it? I have defined the field date_created clearly in my models.py for the catalog app. I'm not sure where else I need to define it?

ImproperlyConfigured at /admin

'ProductAdmin.exclude' refers to field 'date_created' that is missing from the form.

Request Method:     GET
Request URL:    http://localhost:8000/admin
Django Version:     1.3.1
Exception Type:     ImproperlyConfigured
Exception Value:    

'ProductAdmin.exclude' refers to field 'date_created' that is missing from the form.

Exception Location:     /Library/Python/2.6/site-packages/django/contrib/admin/validation.py in check_formfield, line 362
Python Executable:  /usr/bin/python
Python Version:     2.6.1
Python Path:    

['/Users/christopherfarm/Desktop/ecomstore',
 '/Library/Python/2.6/site-packages/python_dateutil-1.5-py2.6.egg',
 '/Library/Python/2.6/site-packages/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg',
 '/Library/Python/2.6/site-packages/django_db_log-2.2.1-py2.6.egg',
 '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip',
 '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6',
 '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin',
 '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac',
 '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages',
 '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python',
 '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk',
 '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old',
 '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload',
 '/Library/Python/2.6/site-packages',
 '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC',
 '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode']

Server time:    Mon, 31 Oct 2011 16:02:11 -0500

Upvotes: 1

Views: 1360

Answers (3)

andilabs
andilabs

Reputation: 23281

I have the very same error. I came back to the project I was not dealing with for a while. And I run it with django==1.5 instead of django==1.6 on which is was working.

so to summarize in my case it was connected with django version on 1.5 I got error like: ExhibitorAdmin.exclude' refers to field 'collectedcontact' that is missing from the form.

while, when switching to django==1.6 this problem for me disappears immediately.

Upvotes: 0

My guess is that you've set auto_now_add or auto_add in your models.py field, thus it's not a part of your form in the first place to exclude.

Try removing it from your exclude statement.

Upvotes: 5

Platinum Azure
Platinum Azure

Reputation: 46193

Did you make the change after the initial syncdb? If so, you need to do a reset on the app in question so that the tables get dropped, re-created, and (if you have fixtures) reloaded.

Alternatively, you can go into the dbshell for your app and alter the table yourself using SQL.

Upvotes: 0

Related Questions