Я хотел создать форму для редактирования личных данных.
# Код формы forms.py
from django import forms
from .models import AdvUser
class ChangeUserInfoForm (forms.ModelForm):
email = forms.EmailField(required=True,
label='Адрес электронной почты')
class Meta:
model = AdvUser
fields = ('username', 'email', 'first_name', 'last_name',
'send_messages')
В браузере такая ошибка:
ValueError at /accounts/profile/change/
ModelForm has no model class specified.
Request Method: GET
Request URL: http://localhost:8000/accounts/profile/change/
Django Version: 3.2.6
Exception Type: ValueError
Exception Value:
ModelForm has no model class specified.
Exception Location: C:\Program Files\lib\site-packages\django\forms\models.py, line 295, in __init__
Python Executable: C:\Program Files\python.exe
Python Version: 3.9.4
Python Path:
['C:\\Django\\bboard',
'C:\\Program Files\\python39.zip',
'C:\\Program Files\\DLLs',
'C:\\Program Files\\lib',
'C:\\Program Files',
'C:\\Program Files\\lib\\site-packages']