Automatically create a Django profile
Thanks to Alon Swartz for this.
A snippet to create a user profile the first time it is accessed. It looks better having user.profile
rather than user.get_profile()
as well.
The User.profile
as you can see above, runs get_or_create
on the Profile
object