{"id":1984,"date":"2022-08-30T15:21:05","date_gmt":"2022-08-30T15:21:05","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/12\/08\/unhandled-exception-in-django-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:21:05","modified_gmt":"2022-08-30T15:21:05","slug":"unhandled-exception-in-django-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/unhandled-exception-in-django-collection-of-common-programming-errors\/","title":{"rendered":"Unhandled Exception in Django-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m trying to deploy a very simple django app to linode, but I keep getting &#8220;Unhandled Exception \/ An unhandled exception was thrown by the application,&#8221; which is horribly unhelpful. I&#8217;m using nginx as my webserver, and I&#8217;ve gone into its error logs to find this:<\/p>\n<pre><code> 2013\/07\/13 11:41:52 [error] 6673#0: *1 FastCGI sent in stderr:\n \"Traceback (most recent call last):   File\n \"\/usr\/lib\/pymodules\/python2.7\/flup\/server\/fcgi_base.py\", line 558, in\n run\n     protocolStatus, appStatus = self.server.handler(self)   File \"\/usr\/lib\/pymodules\/python2.7\/flup\/server\/fcgi_base.py\", line 1118, in\n handler\n     result = self.application(environ, start_response)   File \"\/usr\/local\/lib\/python2.7\/dist-packages\/django\/core\/handlers\/wsgi.py\",\n line 255, in __call__\n     response = self.get_response(request)   File \"\/usr\/local\/lib\/python2.7\/dist-packages\/django\/core\/handlers\/base.py\",\n line 178, in get_response\n     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())   File\n \"\/usr\/local\/lib\/python2.7\/dist-packages\/django\/core\/handlers\/base.py\",\n line 217, in handle_uncaught_exception\n     return debug.technical_500_response(request, *exc_info)   File \"\/usr\/local\/lib\/python2.7\/dist-packages\/django\/views\/debug.py\", line\n 69, in technical_500_response\n     html = reporter.get_traceback_html()   File \"\/usr\/local\/lib\/python2.7\/dist-packages\/django\/views\/debug.py\", line\n 297, in get_traceback_html\n     c = Context(self.get_traceback_data())   File \"\/usr\/local\/lib\/python2.7\/dist-packages\/django\/views\/debug.py\", line\n 255, in get_traceback_data\n     frames = self.get_traceback_frames()   File \"\/usr\/local\/lib\/python2.7\/dist-packages\/django\/views\/debug.py\", line\n 402, in get_traceback_frames\n     pre_context_lineno, pre_context, context_line, post_context = self._get_lines_from_file(filename, lineno, 7, loader, module_name)  \n File \"\/usr\/local\/lib\/python2.7\/dist-packages\/django\/views\/debug.py\",\n line 383, in _get_lines_from_file\n     context_line = source[lineno].strip('\\n') IndexError: list index out of range\" while reading response header from upstream, client:\n xxx.xxx.xxx.xxx, server: xxx.com, request: \"GET \/ HTTP\/1.1\", upstream: \"fastcgi:\/\/127.0.0.1:8080\", host: \"www.xxx.com\n<\/code><\/pre>\n<p>I&#8217;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&#8217;s something to do with the connection between nginx and django, but I really have no idea what the issue could be. Any thoughts?<\/p>\n<ol>\n<li>\n<p>Well at least it&#8217;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?<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-12-08 05:35:51. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m trying to deploy a very simple django app to linode, but I keep getting &#8220;Unhandled Exception \/ An unhandled exception was thrown by the application,&#8221; which is horribly unhelpful. I&#8217;m using nginx as my webserver, and I&#8217;ve gone into its error logs to find this: 2013\/07\/13 11:41:52 [error] 6673#0: *1 FastCGI sent in stderr: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1984","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1984"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1984\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}