Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Aug 11, 2010 1:35 pm 
Offline

Joined: Wed Aug 11, 2010 11:31 am
Posts: 1
Hi,
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 http://library.linode.com/development/f ... 0.04-lucid and http://library.linode.com/development/f ... 0.04-lucid

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, and than try clicking on the links "Overview" or "Archives". You will receive a Django error page.

What seems weird is that the META data is showing some wrong values. On the error page, you will see that
Code:
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)
Code:
'/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

Code:
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 :
Code:
<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


Top
   
 Post subject:
PostPosted: Thu Aug 12, 2010 5:13 am 
Offline
Senior Member

Joined: Fri Feb 18, 2005 4:09 pm
Posts: 594
Where you have:

Code:
wsgi_dir = os.path.abspath(os.path.dirname(__file__))
project_dir = os.path.dirname(wsgi_dir)
sys.path.append(project_dir)



I use:

Code:
if os.path.dirname( os.path.realpath( __file__ ) )  not in sys.path:
    sys.path.append(os.path.dirname( os.path.realpath( __file__ ) ) )



James


Top
   
 Post subject:
PostPosted: Fri Aug 13, 2010 9:22 am 
Offline
Senior Member

Joined: Fri Feb 18, 2005 4:09 pm
Posts: 594
Here is a Python WSGI testing framework that does not require a web server installation, seems interesting. I'm going to try it out today.

http://pythonpaste.org/webtest/

James


Top
   
 Post subject:
PostPosted: Fri Aug 13, 2010 9:34 am 
Offline
Senior Member

Joined: Fri Feb 18, 2005 4:09 pm
Posts: 594
Note from the README that the source code repository has changed:


Development no longer occurs in this repository

Please see:

http://bitbucket.org/ianb/webtest

Check out with:

hg clone http://bitbucket.org/ianb/webtest

Download from:

http://bitbucket.org/ianb/webtest/get/tip.gz


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group