Jump to content

[Solved] Hosting Django Project


clyde

Recommended Posts

I know this has been talked about quite a bit on the forums, but I've read over all the posts and have not been able to resolve the issue. I have followed the instructions here.

I have made the .htaccess file and the dispatch.wsgi file. .htaccess is successfully rewriting urls to use dispatch.wsgi, but when I try to call the django WSGI handler with:

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

I get a 500 Internal Service error. I imagine this means I have something wrong in my settings.py file, so I modified the wsgi file to do just a simple "hello world":

def application(environ, start_response):
    """Simplest possible application object"""
    output = "Hello World"
    status = '200 OK'
    response_headers = [('Content-type', 'text/plain'),
                        ('Content-Length', str(len(output)))]
    start_response(status, response_headers)
    return [output]

which works fine. I've played with it a bit and it now seems quite clear that the problem occurs after django gets involved. I've put some debugging statements in the wsgi file with 'sys.stderr.write' statements but I don't see anything in the error log. It's completely blank. Is the error log working? Or is there an alternative log you can show me?

My username is sonny and I'm trying to get my django app working here. Thank you for any help

 

Link to comment
Share on other sites

We had a problem with our error_log processing. Are you seeing anything in your error_log now?

 

This is what I'm seeing:

[Mon Apr 05 11:12:00 2010] [error] got here 1!['/home/sonny/public_html/bradweb/', '/usr/lib64/python2.4/site-packages/setuptools-0.6c5-py2.4.egg', '/usr/lib64/python2.4/site-packages/MySQL_python-1.2.2-py2.4-linux-x86_64.egg', '/usr/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg', '/usr/lib/python2.4/site-packages/flup-1.0.1-py2.4.egg', '/usr/lib/python2.4/site-packages/pysqlite-2.5.0-py2.4-linux-x86_64.egg', '/usr/lib64/python24.zip', '/usr/lib64/python2.4', '/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk', '/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages', '/usr/lib64/python2.4/site-packages/PIL', '/usr/lib64/python2.4/site-packages/gtk-2.0', '/usr/lib/python2.4/site-packages']
[Mon Apr 05 11:12:00 2010] [error] [client 128.208.7.226] mod_wsgi (pid=26666): Exception occurred processing WSGI script '/home/sonny/public_html/bradweb/dispatch.wsgi'.
[Mon Apr 05 11:12:00 2010] [error] [client 128.208.7.226]   File "/home/sonny/public_html/bradweb/dispatch.wsgi", line 13, in application

Link to comment
Share on other sites

Yes, the error log is working great now! Thanks a lot djbob, the log is very helpful. I have been able to use the logs to debug my problem (turns out I just had the incorrect path to .python_egg_cache) and it works great now!

Thanks again for your help and your time.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...