Monday, August 24, 2015

Re: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited; form CommitmentForm needs updating

You need to set the fields attribute in the Meta class of your ModelForm:


Or, if you are not using a custom ModelForm (Django is building it for you dynamically), then you need to specify the fields on your view:


-James

On Mon, Aug 24, 2015 at 12:07 AM, Francis Louis <francis.louis@gmail.com> wrote:
Hi All,

May I ask this question,

I am using Django 1.8.4 with Python 2.7

After I run the development server by running this command c:\Python27\python.exe manage.py runserver and access the below given URL,


I get this error, May I know how to resolve this issue?

Best Regards
Francis

ImproperlyConfigured at /

Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited; form CommitmentForm needs updating.
Request Method:GET
Request URL:http://127.0.0.1:8000/
Django Version:1.8.4
Exception Type:ImproperlyConfigured
Exception Value:
Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited; form CommitmentForm needs updating.
Exception Location:c:\Python27\lib\site-packages\django\forms\models.py in __new__, line 274
Python Executable:c:\Python27\python.exe
Python Version:2.7.10
Python Path:
['c:\\data1\\SocialGame\\sg',   'C:\\windows\\SYSTEM32\\python27.zip',   'c:\\Python27\\DLLs',   'c:\\Python27\\lib',   'c:\\Python27\\lib\\plat-win',   'c:\\Python27\\lib\\lib-tk',   'c:\\Python27',   'c:\\Python27\\lib\\site-packages',   'c:\\data1\\SocialGame\\sg',   'c:\\data1\\SocialGame\\sg\\SocialGame\\../..',   'c:\\data1\\SocialGame\\sg']
Server time:Mon, 24 Aug 2015 15:03:37 +0800

--
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.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/28ad1260-55f4-4eb2-af6c-5daee988e0ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciW3Y%2B7pJqU0suMYHq2eGvNRB55msUEK7TVEdvPgg50Enw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment