November 2015
Beginner to intermediate
840 pages
26h 30m
English
When we created our new User model, we removed the username field, choosing to use only the email field for user authentication. This is a bit of a problem because the UserCreationForm uses the username to create the Profile object. The profile_detail.html also needs to be changed because it calls get_username(), which will now display the email and needs to instead use get_full_name().
This transition away from username is made possible largely because of the name field added to the Profile model. Our goal is thus to ask the user for a value for the name field and then to use it to create the Profile, including the generation of the slug field on Profile.
Our first change to UserCreationForm is thus to ...
Read now
Unlock full access