Skip to content

Instantly share code, notes, and snippets.

@shubham1710
Created September 6, 2020 10:29
Show Gist options
  • Save shubham1710/09be219dfc852ade4be00225453bc2f7 to your computer and use it in GitHub Desktop.
Save shubham1710/09be219dfc852ade4be00225453bc2f7 to your computer and use it in GitHub Desktop.
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