from django import forms from django_registration.forms import RegistrationForm from .models import User, UserProfile class UserForm(RegistrationForm): class Meta(RegistrationForm.Meta): model = User class ProfileForm(forms.ModelForm): class Meta: model = UserProfile fields = '__all__' def __init__(self, *args, **kwargs): self.user = kwargs.pop("user", None) super(ProfileForm, self).__init__(*args, **kwargs)