I have been getting this error referring to this method in my views.py file:
def AddNewUser(request):
a=AMI()
if(request.method == "POST"):
print(request.POST)
# print(request['newUser'])
# print(request['password'])
return render_to_response("ac/AddNewUser.html", {})
But my other functions work just fine. It's just this button in my HTML file that doesn't work.
<form name="AddNewUser" action="/ac/AddNewUser" method="post"> {% csrf_token %} <input type="submit" name="addNewUser" id="addNewUser" value="Create User"></form>
As you can see I've got the {% csrf_token %} but it's still not working. I also know some people are having this problem if they don't have MIDDLEWARE_CLASSES in their settings.py but I have that inserted correctly. What could be causing this problem? The only other line in the error says: "The view function uses RequestContext for the template, instead of Context." But I don't know what that could mean.