Create account edit page in Django
In the previous tutorial we created a sign up / register page. We now need to create a page to edit the information for the user.
Create the form
In the 'users' app folder, open 'forms.py'. This should currently have the 'UserRegistrationForm'. Now copy the entire class, and rename it 'UserViewForm'. Also remove the references to 'password1' and 'password2':
class UserViewForm (UserCreationForm):
email = forms.EmailField(required=True)
first_name = forms.CharField(required=True)
last_name = forms.CharField(required=True)
class Meta:
model=User
fields = [
'username',
'first_name',
'last_name',
'email',
]