Reputation: 139
I have read the official documentation for UserCreationForm(). I am trying to access the users I have created within other models. What model do I call to access the users I created within the UserCreationForm()? In short is their a default authentication model I can call to access the user model?
Upvotes: 1
Views: 188
Reputation: 477180
What model do I call to access the users I created within the
UserCreationForm()
?
As we can see in the source code [GitHub], it uses the User
model:
from django.contrib.auth.models import User # … class UserCreationForm(forms.ModelForm): # … class Meta: model = User fields = ("username",) field_classes = {'username': UsernameField} # …
You thus can import this model with:
from django.contrib.auth.models import User
The documentation on the User
specifies the fields and methods defined on this model.
Upvotes: 1