I'm storing some additional per-user information using the AUTH_PROFILE_MODULE
.
We can access the user in a Django template using {{ request.user }}
but how do we access fields in the profile since the profile is only accessible via a function user.get_profile()
?
Is it really required to explicitly pass the profile into the template every time?
Use {{ request.user.get_profile.whatever }}
. Django's templating language automatically calls things that are callable - in this case, the .get_profile()
method.