2👍
✅
If you’re using the default User
model from django.contrib.auth.models
, it has a get_full_name
method that you can use in your template:
{{ user.get_full_name }}
Otherwise, you can implement that method in your own User
model too. Any method that accepts no arguments can be called from templates (unless they have a alters_data
attribute set to True
).
Source:stackexchange.com