Search code examples
djangodjango-templatesdjango-authentication

difference between "request.user.is_authenticated" and "user.is_authenticated"


in django template what is the difference between request.user.is_authenticated and user.is_authenticated

{% if request.user.is_authenticated %}

and

{% if user.is_authenticated %}

thanks in advance


Solution

  • They are the same, it just depends if request.user or just the base request is being sent to the template.