Custom Search

SUBSCRIBE

SUBSCRIBE : 300 + Free Video Tutorials Programming (Python, golang, Julia), DevOps

Wednesday, November 30, 2016

python django.core.exceptions.ImproperlyConfigured: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited; form BuildingAdminForm needs updating.

Error:
python django.core.exceptions.ImproperlyConfigured: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited; form BuildingAdminForm needs updating.

Fix:
Add fields = "__all__" inn Meta class of your model form
class MyAdminForm(forms.ModelForm):
    class Meta:
        model = MyModel
        fields = "__all__"


No comments:

Post a Comment