Advertisement
robertvari

Custom User Forms

Dec 17th, 2019
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. from .models import CustomUser
  2.  
  3. from django.contrib.auth.forms import UserCreationForm, UserChangeForm
  4.  
  5.  
  6. class CustomUserCreationForm(UserCreationForm):
  7.     class Meta:
  8.         model = CustomUser
  9.         fields = ('email', "full_name", "password1", "password2")
  10.  
  11.  
  12. class ProfileForm(UserChangeForm):
  13.     class Meta:
  14.         model = CustomUser
  15.         fields = (
  16.             "email",
  17.             "full_name",
  18.             "profile_pic",
  19.             "location",
  20.             "birth_date",
  21.             "bio",
  22.             "linkedin",
  23.             "facebook",
  24.             "twitter",
  25.             "instagram",
  26.         )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement