[Answer]-Move variable from one function to another (in Django user registration), python

1👍

because the HttpResponse is not returned the login_view call does nothing.

if your user is logged in then any request should automatically contain that user. so, for example:

if request.user.is_authenticated():
    user = request.user
    context['user'] = user.username

otherwise you could pass the user in the url and then get the username in the view (or just use the user object in the template and insert {{ user.username }} into your template.

Leave a comment