Django - Dispatch.fcgi displaying correct output in terminal, but browser leads to Unhandled Exception

141 views Asked by At

I have just installed Django-cms and am running Django using FastCGI and flup on shared hosting. When I call "dispatch.fcgi" from the terminal, I get the correct html output. However, when I try to go to my website from a browser, I get the nonspecific error:

An unhandled exception was thrown by the application.

Here is the output from terminal for running ./dispatch.fcgi:

Status: 200 OK
Vary: Accept-Language, Cookie
X-Frame-Options: SAMEORIGIN
Content-Type: text/html; charset=utf-8
Content-Language: en-us

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
<head>

and so on

I already tried adding an if/else statement to the dispatch.fcgi file that writes it's errors to an error log, but the log is empty!

Anyone have any clue where the error is occurring? How can I get more information on the "Unhandled exception?"

Edit: Below is dispatch.fcgi:

#!/usr/bin/python

from traceback import format_exc
try:
    # current dispatch.fcgi code

    import sys
    import os

#Make sure to change 'username' to your username!
    sys.path.insert(0, '/home/mcgillme/atlas/atlasproject')

    os.environ['DJANGO_SETTINGS_MODULE'] = 'testatlas.settings'

    import django.core.handlers.wsgi



    from django.core.servers.fastcgi import runfastcgi
    runfastcgi(method="threaded", daemonize="false")

except Exception:
    open("/dispatcherrors.txt", "w").write(format_exc())
    raise
0

There are 0 answers