Jump to content

[Solved] django not working


fengshaun

Recommended Posts

Hi,

 

I'm having trouble setting up a django project on heliohost. I have tried to track down the problem and it seems to be coming from dispatch.wsgi. Here is public_html/dispatch.wsgi:

 

import os
import sys
output = ""


sys.path.append('/home/amoradi/public_html')
sys.path.append('/home/amoradi/public_html/mysite')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' #my project name mysite
os.environ['PYTHON_EGG_CACHE'] = '/home/amoradi/.python_egg_cache' #right 775

try:
    import django
except Exception, e:
    output = "import django error: %s" % e

def application(environ, start_response):
    status = '200 OK'
    #output = 'Hello World!'

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

    return [output]

 

When I try to go to load a page, it gives me: "import django error: No module named django." Is there any problem with the django installation or am I missing something?

 

username: amoradi

url: fengshaun.heliohost.org

 

Thank you.

Link to comment
Share on other sites

That error is gone, but now loading the site waits indefinitely. The error log isn't helpful:

 

[Tue May 11 15:28:06 2010] [error] [client xx.xxx.xxx.x] mod_wsgi (pid=25626): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.

 

(just this one line of error.)

 

and this is my dispatch.wsgi:

 

try:
    import os
    import sys

    sys.path.append("/home/amoradi/public_html/mysite")

    os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
    os.environ['PYTHON_EGG_CACHE'] = '/home/amoradi/.python_egg_cache'

    import django.core.handlers.wsgi
    application = django.core.handlers.wsgi.WSGIHandler()
except Exception, e:
    def application(environ, start_response):
        output = "error: %s" % e
        status = '200 OK'
        response_headers = [('Content-type', 'text/plain'),
                            ('Content-Length', str(len(output)))]
        start_response(status, response_headers)
        return [output]

 

Thank you for your help.

Link to comment
Share on other sites

Here's the last bunch of errors for you:

[Tue May 11 18:46:17 2010] [error] [client 24.222.236.5] mod_wsgi (pid=27582): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 18:46:17 2010] [error] [client 24.222.236.5]   File "/home/amoradi/public_html/mysite/dispatch.wsgi", line 9, in application
[Tue May 11 18:46:17 2010] [error] [client 24.222.236.5]   [Errno 13] Permission denied: '/home/amoradi/.python_egg_cache/hashlib-20081119-py2.4-linux-x86_64.egg-tmp'
[Tue May 11 18:46:17 2010] [error] [client 24.222.236.5]   /home/amoradi/.python_egg_cache
[Tue May 11 18:48:14 2010] [error] [client 24.222.236.5] mod_wsgi (pid=28450): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 18:48:14 2010] [error] [client 24.222.236.5]   File "/home/amoradi/public_html/mysite/dispatch.wsgi", line 9, in application
[Tue May 11 18:48:14 2010] [error] [client 24.222.236.5]   [Errno 13] Permission denied: '/home/amoradi/.python_egg_cache/hashlib-20081119-py2.4-linux-x86_64.egg-tmp'
[Tue May 11 18:48:14 2010] [error] [client 24.222.236.5]   /home/amoradi/.python_egg_cache
[Tue May 11 18:49:16 2010] [error] [client 24.222.236.5] mod_wsgi (pid=28276): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 18:49:16 2010] [error] [client 24.222.236.5]   File "/home/amoradi/public_html/mysite/dispatch.wsgi", line 9, in application
[Tue May 11 18:49:16 2010] [error] [client 24.222.236.5] mod_wsgi (pid=28276): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 18:49:16 2010] [error] [client 24.222.236.5]   File "/home/amoradi/public_html/mysite/dispatch.wsgi", line 9, in application
[Tue May 11 18:49:19 2010] [error] [client 24.222.236.5] mod_wsgi (pid=29137): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 18:49:19 2010] [error] [client 24.222.236.5]   File "/home/amoradi/public_html/mysite/dispatch.wsgi", line 9, in application
[Tue May 11 18:49:19 2010] [error] [client 24.222.236.5] mod_wsgi (pid=29137): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 18:49:19 2010] [error] [client 24.222.236.5]   File "/home/amoradi/public_html/mysite/dispatch.wsgi", line 9, in application
[Tue May 11 18:52:09 2010] [error] [client 24.222.236.5] mod_wsgi (pid=31624): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 18:52:09 2010] [error] [client 24.222.236.5] mod_wsgi (pid=31624): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 14:54:04 2010] [error] [client 24.222.236.5] mod_wsgi (pid=1369): Target WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi' cannot be loaded as Python module.
[Tue May 11 14:54:04 2010] [error] [client 24.222.236.5] mod_wsgi (pid=1369): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 14:54:04 2010] [error] [client 24.222.236.5]   File "/home/amoradi/public_html/mysite/dispatch.wsgi", line 10
[Tue May 11 14:54:04 2010] [error] [client 24.222.236.5] mod_wsgi (pid=1369): Target WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi' cannot be loaded as Python module.
[Tue May 11 14:54:04 2010] [error] [client 24.222.236.5] mod_wsgi (pid=1369): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 14:54:04 2010] [error] [client 24.222.236.5]   File "/home/amoradi/public_html/mysite/dispatch.wsgi", line 10
[Tue May 11 14:55:04 2010] [error] [client 24.222.236.5] mod_wsgi (pid=1337): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 15:13:38 2010] [error] [client 24.222.236.5] mod_wsgi (pid=15460): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 15:14:23 2010] [error] [client 24.222.236.5] mod_wsgi (pid=12511): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 15:16:33 2010] [error] [client 24.222.236.5] mod_wsgi (pid=17567, process='', application='fengshaun.heliohost.org|/mysite/dispatch.wsgi'): Failed to parse WSGI script file '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 15:16:33 2010] [error] [client 24.222.236.5] mod_wsgi (pid=17567): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 15:16:33 2010] [error] [client 24.222.236.5] mod_wsgi (pid=17567, process='', application='fengshaun.heliohost.org|/mysite/dispatch.wsgi'): Failed to parse WSGI script file '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 15:16:33 2010] [error] [client 24.222.236.5] mod_wsgi (pid=17567): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 15:17:22 2010] [error] [client 24.222.236.5] mod_wsgi (pid=18089): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 15:17:32 2010] [error] [client 24.222.236.5] mod_wsgi (pid=17952): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 15:18:26 2010] [error] [client 24.222.236.5] mod_wsgi (pid=18098): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 15:19:44 2010] [error] [client 24.222.236.5] mod_wsgi (pid=17934): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 15:21:55 2010] [error] [client 24.222.236.5] mod_wsgi (pid=21500): Exception occurred processing WSGI script '/home/amoradi/public_html/dispatch.wsgi'.
[Tue May 11 19:22:59 2010] [error] [client 24.222.236.5] mod_wsgi (pid=17563): Exception occurred processing WSGI script '/home/amoradi/public_html/dispatch.wsgi'.
[Tue May 11 19:22:59 2010] [error] [client 24.222.236.5] mod_wsgi (pid=17563): Exception occurred processing WSGI script '/home/amoradi/public_html/dispatch.wsgi'.
[Tue May 11 19:22:59 2010] [error] [client 24.222.236.5]   File "/home/amoradi/public_html/mysite/urls.py", line 4, in ?
[Tue May 11 15:23:27 2010] [error] [client 24.222.236.5] mod_wsgi (pid=21073): Exception occurred processing WSGI script '/home/amoradi/public_html/dispatch.wsgi'.
[Tue May 11 15:23:47 2010] [error] [client 24.222.236.5] mod_wsgi (pid=22309): Exception occurred processing WSGI script '/home/amoradi/public_html/dispatch.wsgi'.
[Tue May 11 19:27:29 2010] [error] [client 24.222.236.5] mod_wsgi (pid=23637): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 19:27:29 2010] [error] [client 24.222.236.5] mod_wsgi (pid=23637): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.
[Tue May 11 15:28:06 2010] [error] [client 24.222.236.5] mod_wsgi (pid=25626): Exception occurred processing WSGI script '/home/amoradi/public_html/mysite/dispatch.wsgi'.

Link to comment
Share on other sites

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