1š
I am not sure why you are getting the OK page. However, I used your code with ārenderā replacing ārender_to_responseā:
render(request, āposter_login.htmlā,{āstateā:state, āusernameā: username})
And with ācsrf_tokenā in your template:
{% csrf_token %}
ā¦
Doing this gives the expected result on my setup.
Source:stackexchange.com