[Fixed]-Setting request.session causes HTTP 500 Error when posting form to Django


The problem was I hadn’t synced my database. I did not have, amoung other things, the authentication and session tables. Doing the following fixed the problem:

python migrate.py syncdb


The error is occurring in your response variable value.
You are returning the Http404 type object in your exception, this will raise an AttributeError, so it’s an exception leading to another exception.

From the code you provided above the only thing i can think of is that you didn’t import
You need to :
from django.http import HttpResponse

if this doesn’t work you ll need to provide the traceback.

Leave a comment