I got a strange heroku behavior.
My code:
def generate(request, page_id):
page = get_object_or_404(Page, pk=page_id)
response = HttpResponse(page.content)
response['Content-Type'] = 'text/plain'
return response
works as I expect on dev, but on heroku it raises an exception
GET test.herokuapp.com/generate/1 dyno=web.1 queue=0 wait=0ms service=908ms status=500 bytes=59
2012-07-29T19:20:06+00:00 app[web.1]: raise TemplateDoesNotExist(name)
2012-07-29T19:20:06+00:00 app[web.1]: TemplateDoesNotExist: 500.html
and returns proper output 😉 Only this one action is wrong. Other actions where I use
return render_to_response('front/home.html')
are Ok. What could be wrong?
That code throws an unhandled exception, which, outside of debug mode, makes Django display an error page that uses template
500.html. You apparently have no such template, so the exception handler raises another exception, which is the one you’re seeing.