[Answer]-Django login_required not redirecting

1👍

You’re not passing your context to the template in index, so it knows nothing about the user variable. You should do:

return render_to_response('evaluation/index.html', context)

or even better, drop the context variable altogether and just do

return render(request, 'evaluation/index.html')

(since render, unlike render_to_response, uses RequestContext by default).

Leave a comment