Unhandled Exception in Django-Collection of common programming errors

I’m trying to deploy a very simple django app to linode, but I keep getting “Unhandled Exception / An unhandled exception was thrown by the application,” which is horribly unhelpful. I’m using nginx as my webserver, and I’ve gone into its error logs to find this:

 2013/07/13 11:41:52 [error] 6673#0: *1 FastCGI sent in stderr:
 "Traceback (most recent call last):   File
 "/usr/lib/pymodules/python2.7/flup/server/fcgi_base.py", line 558, in
 run
     protocolStatus, appStatus = self.server.handler(self)   File "/usr/lib/pymodules/python2.7/flup/server/fcgi_base.py", line 1118, in
 handler
     result = self.application(environ, start_response)   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py",
 line 255, in __call__
     response = self.get_response(request)   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py",
 line 178, in get_response
     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())   File
 "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py",
 line 217, in handle_uncaught_exception
     return debug.technical_500_response(request, *exc_info)   File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line
 69, in technical_500_response
     html = reporter.get_traceback_html()   File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line
 297, in get_traceback_html
     c = Context(self.get_traceback_data())   File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line
 255, in get_traceback_data
     frames = self.get_traceback_frames()   File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line
 402, in get_traceback_frames
     pre_context_lineno, pre_context, context_line, post_context = self._get_lines_from_file(filename, lineno, 7, loader, module_name)  
 File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py",
 line 383, in _get_lines_from_file
     context_line = source[lineno].strip('\n') IndexError: list index out of range" while reading response header from upstream, client:
 xxx.xxx.xxx.xxx, server: xxx.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:8080", host: "www.xxx.com

I’ve done plenty of looking around online but have found nothing so far that could help me. I know nginx is at least partly correctly configured, because I can go to my static directory and pull files from there with no issues. So it’s something to do with the connection between nginx and django, but I really have no idea what the issue could be. Any thoughts?

  1. Well at least it’s a django exception which is good it means your server is finding django. Are you just trying to display the default django page or have you pointed django to a pre-existing application?