Django View error


Posted:

Note to self: whenever Django complains that a view didn't return an HttpResponse object, it means you probably forgot to 'return' the render_to_response or HttpResponse in your view method.

Example:

def blah_view(request):
    # work here
    render_to_response('path/to/template.html')

The above code will return:
ValueError

The view blah_view didn't return an HttpResponse object.
Comments powered by Disqus
Share