Jump to content

[Answered] Django Project Will Not Work - Error In Dispatch.wsgi


dvance

Recommended Posts

I have tried to follow the guidelines for uploading a django project to my account, and I have tried to follow the wiki's guide to debug the dispatch.wsgi file, but I don't seem to be getting any productive feedback. The site was working on the django 1.3.7 development server.

 

Ideally, an index.html page powered by django would appear at <http://www.8bitphotos.com>, but only a directory index appears. I hit "500 Internal Server Error" when trying to access <http://www.8bitphoto...eightbitphotos/>, in which my project files are saved.

 

What do I need in order to get things running smoothly?? I've tried things from other forum topics but without any luck. Thanks for any help you can provide.

 

username: dvance

 

error log after trying to access <http://www.8bitphoto...eightbitphotos/>:

[sat May 11 19:12:58 2013] [error] [client 76.27.60.233] File does not exist: /home1/dvance/public_html/404.shtml

[sat May 11 19:12:58 2013] [error] [client 76.27.60.233] File does not exist: /home1/dvance/public_html/favicon.ico

[sat May 11 19:12:58 2013] [error] [client 76.27.60.233] File does not exist: /home1/dvance/public_html/500.shtml, referer: http://www.8bitphotos.com/

[sat May 11 19:12:58 2013] [error] [client 76.27.60.233] File "/home1/dvance/public_html/eightbitphotos/dispatch.wsgi", line 13, in application, referer: http://www.8bitphotos.com/

[sat May 11 19:12:58 2013] [error] [client 76.27.60.233] mod_wsgi (pid=20162): Exception occurred processing WSGI script '/home1/dvance/public_html/eightbitphotos/dispatch.wsgi'., referer: http://www.8bitphotos.com/

 

dispatch.wsgi file:

try:

import os, sys

sys.path.append("/home1/dvance/public_html/eightbitphotos");

 

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

os.environ['PYTHON_EGG_CACHE'] = '/home/dvance/.python_egg_cache'

 

import django.core.handlers.wsgi

_application = django.core.handlers.wsgi.WSGIHandler()

 

def application(environ, start_response):

environ['PATH_INFO'] = environ['SCRIPT_NAME'] + environ['PATH_INFO']

return _application(environ, start_response) ### line 13

except:

import traceback

trace = traceback.format_exc()

def application(environ, start_response):

status = '500 Internal Server Error'

output = trace

 

response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))]

start_response(status, response_headers)

 

return [output]

Link to comment
Share on other sites

  1. Download http://area52.heliohost.org/djangotest.zip
  2. Extract to a directory in your public_html
  3. Create /home/<username>/.python_egg_cache
  4. Chmod 777 .python_egg_cache
  5. Edit /home/<username>/public_html/<djangofolder>/dispatch.wsgi
  6. sys.path.append("/home/<username>/public_html/<djangofolder>");
  7. os.environ['PYTHON_EGG_CACHE'] = '/home/<username>/.python_egg_cache'

Link to comment
Share on other sites

  • 2 weeks later...

Ok - I can get djangotest running, thanks for that.

 

I was able to go to "http://<mydomain>/djangotest" and the django page came up.

However, I tried to give the djangotest directory a new name and edit the dispatch.wsgi to match the new name. When I went to "http://<mydomain>/<newname>", a server error page came up telling me that it couldn't find "/djangotest/dispatch.wsgi." Why is it thinking to look there? I don't know anything else that references it. Why didn't it go to the new directory name?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...