I am trying to make a custom middleware class that will check token from cookie with another data (not the point where this data is) and return username or some error.
I guess it should be done in process_request method, but how to give this username further to process_view method?
In my template I want to use smth like this:
{% if logged_in then _show_username else _show_loginform_ %}