[Answer]-Django : user.is_authenticated, works without passing 'user'?

1👍

You can access to the user object even if you don’t pass it implicitly in the view response.
By default it is an anonymous user, until an user log in and authenticates itself

0👍

You probably have the auth context processor and/or middleware set which adds the user variable to context

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.contrib.auth.context_processors.auth",
)

MIDDLEWARE_CLASSES = (
    "django.contrib.auth.middleware.AuthenticationMiddleware",
)

Leave a comment