Created
September 6, 2020 10:29
-
-
Save shubham1710/09be219dfc852ade4be00225453bc2f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
from django.contrib.auth.models import User | |
from django.contrib.auth.forms import UserCreationForm | |
from .models import Profile | |
class UserRegisterForm(UserCreationForm): | |
email = forms.EmailField() | |
class Meta: | |
model = User | |
fields = ['username', 'email', 'password1', 'password2'] | |
class UserUpdateForm(forms.ModelForm): | |
email = forms.EmailField() | |
class Meta: | |
model = User | |
fields = ['username', 'email'] | |
class ProfileUpdateForm(forms.ModelForm): | |
class Meta: | |
model = Profile | |
fields = ['bio', 'image'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment