Jump to content

Django And Wsgi Issues


Recommended Posts

Hi,

 

I've coded up a simple picture blog to familarize myself with Django and I wanted to deploy it on HelioHost.

 

I'm running on Johnny with username "aspring".

 

The error I can see is:

[Fri Aug 03 16:40:45 2012] [error] [client 72.2.175.249] mod_wsgi (pid=16450): Exception occurred processing WSGI script '/home/aspring/public_html/PictureBlog/dispatch.wsgi'.
[Fri Aug 03 16:40:45 2012] [error] [client 72.2.175.249] mod_wsgi (pid=16450, process='', application='aspring.heliohost.org|/pictureblog/dispatch.wsgi'): Failed to parse WSGI script file '/home/aspring/public_html/PictureBlog/dispatch.wsgi'.

 

NEW ERROR(old one stopped showing up, new one is more specific):

[Fri Aug 03 22:38:01 2012] [error] [client 72.2.175.249] File does not exist: /home/aspring/public_html/500.shtml
[Fri Aug 03 22:38:01 2012] [error] [client 72.2.175.249]   File "/home/aspring/public_html/PictureBlog/dispatch.wsgi", line 15, in application
[Fri Aug 03 22:38:01 2012] [error] [client 72.2.175.249] mod_wsgi (pid=7057): Exception occurred processing WSGI script '/home/aspring/public_html/PictureBlog/dispatch.wsgi'.

 

My wsgi script located at /home/aspring/public_html/PictureBlog/dispatch.wsgi:

import os, sys
sys.path.append("/home/aspring/public_html/PictureBlog");

### EDIT LINE ABOVE TO YOUR SITE ###

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

### YOU NEED TO CREATE THE DIRECTORY ABOVE ###

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)

 

My .htaccess located at /home/aspring/public_html/PictureBlog/.htaccess:

RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(admin_media/.*)$ - [L]
RewriteRule ^(dispatch\.wsgi/.*)$ - [L]
RewriteRule ^(.*)$ PictureBlog/dispatch.wsgi/$1 [QSA,PT,L]

 

 

Both of these have proper permissions set, same with my /home/aspring/.python_egg_cache

I have checked that a billion times.

 

SOLVED: Please Close

The solution was a difference in versions between the latest django and what is actually hosted on johnny. johnny uses 1.3.1 if I recall correctly and django release is currently 1.4

I directly transferred my project in through ftp. The problem with this is that the settings.py file from 1.4 contains some things that 1.3.1 does not support and won't recognize. Thus I compared the djangotest settings.py file with mine and eliminated the logging and some other settings so that mine would work.

Now I'm onto the issues of why it won't read my sqlite3 db. Fun stuff!

 

 

Thanks so much for what you guys do. I really appreciate it.

 

Aaron

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...