I have defined a user model inheriting AbstractUser
from django.auth.models
. How can I refer to each individual fields of that customized user model? Say if I want to refer to date of birth of the customised user what should I write? I need to show the user profile, so in show_profile.html
file, I wrote :
first name = {{ settings.AUTH_USER_MODEL.first_name }}
date 0f birth = {{ settings.AUTH_USER_MODEL.dob }}
But it didn't work. Any idea? Moreover, my url route looks like this:
path('my-profile/', views.ProfileView.as_view(), name='my_profile'),
The concerned line in base.html is:
<a class="dropdown-item" href="{% url 'my_profile' %}">Edit profile</a>
The concerned lines in views.py are:
class ProfileView(LoginRequiredMixin, TemplateView):
template_name = 'show_profile.html'
Please tell where I have done wrong.