[Fixed]-Setting custom user object in context processor in django


If you have the request template context processor enabled, you’ll be able to access the user in the template with {{ request.user}}.

Secondly, make sure you are importing the login function and not the login view. It should be:

from django.contrib.auth import login

Leave a comment