Unable to set up Django 1.1.2 using WSGI, on ubuntu 10.04
I need your help in setting up Django with mod-wsgi ( on ubuntu 10.04 ), and I apologize for this really long post.
I am having problems with setting up Django on my linode based on the tutorials found at
the directory set up was also based on the tutorial.
It seems that WSGI is unable to import my views, although it is there and working on my local computer. My django project works previously ( when i was using mod_python on ubuntu 10.04 ), so I am very sure that my views.py for my apps are all there and conrrectly configured.
I need you to have a look at: http://www.tabbing.me
What seems weird is that the META data is showing some wrong values. On the error page, you will see that
PATH_TRANSLATED :
'/srv/www/tabbing.me/django/tabshift/django.wsgi/rapidtask/quadrant_view/'
But what I need is (notice that there is no django.wsgi)
'/srv/www/tabbing.me/django/tabshift/rapidtask/quadrant_view/'
My configuration are almost the same based on the tutorials in this post:
#
At: /srv/www/tabbing.me/django/tabshift/django.wsgi
import os
import sys
wsgi_dir = os.path.abspath(os.path.dirname(__file__))
project_dir = os.path.dirname(wsgi_dir)
sys.path.append(project_dir)
project_settings = os.path.join(project_dir,'settings')
os.environ['PYTHON_EGG_CACHE'] = '/srv/www/tabbing.me/.python-egg'
os.environ['DJANGO_SETTINGS_MODULE'] = 'tabshift.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
#
At: /etc/apache2/sites-available/tabbing.me :
<virtualhost 173.230.150.63:80="">ServerAdmin netosis@gmail.com
ServerName tabbing.me
ServerAlias www.tabbing.me
DocumentRoot /srv/www/tabbing.me/django/tabshift
WSGIScriptAlias / /srv/www/tabbing.me/django/tabshift/django.wsgi
Alias /blog /srv/www/tabbing.me/public_html/blog
Alias /public_media /srv/www/tabbing.me/django/tabshift/public_media
ErrorLog /srv/www/tabbing.me/logs/error.log
CustomLog /srv/www/tabbing.me/logs/access.log combined</virtualhost>
Please help~~ What webt wrong? Why is WSGI not able to import my views.py when its there?
any advice or tutorials are more than welcomed!
Best Regards,
Eugene
3 Replies
wsgi_dir = os.path.abspath(os.path.dirname(__file__))
project_dir = os.path.dirname(wsgi_dir)
sys.path.append(project_dir)
I use:
if os.path.dirname( os.path.realpath( __file__ ) ) not in sys.path:
sys.path.append(os.path.dirname( os.path.realpath( __file__ ) ) )
James
James
Development no longer occurs in this repository
Please see:
Check out with:
hg clone
Download from: