WSGI / python module import quesion / problem

6 views
Skip to first unread message

Blake

unread,
May 19, 2010, 7:54:59 PM5/19/10
to WSGI Components
Hi All,

I've been playing around with wsgi on ubuntu 10.04, and I'm having
trouble importing modules I've written in the project directory when
running in daemon mode with apache.

I've tried setting an additional python path like this in apache.conf
and wsgi.conf (but not simultaneously):

WSGIPythonPath directory|/home/blake/workspace/testWebApp001/src

...and am getting no love. I always get an internal server error and a
message in the log saying that that the module I'm trying to import
doesn't exist. However, the standard library modules import with no
problem.

Also, sys.argv[0] is mod_wsgi instead of /home/blake/workspace/
testWebApp001/src/testApp001.py

Finally, when I test to program with wsgiref.simple_server, everything
works fine.

Any ideas?

Thanks,

Blake

PS: Here's my virtual host file for the test site:

<VirtualHost *:80>

ServerName www.testsite.com
ServerAlias testsite.com
ServerAdmin bl...@testsite.com

DocumentRoot /var/www/testSite001
Alias /robots.txt /var/www/testSite001/robots.txt
Alias /favicon.ico /var/www/testSite001/favicon.ico
Alias /media/ /var/www/testSite001/media/

<Directory /var/www/testSite001>
Order allow,deny
Allow from all
</Directory>

WSGIDaemonProcess testsite.com processes=1 threads=15 display-name=%
{GROUP}
WSGIProcessGroup testsite.com

WSGIScriptAlias / /home/blake/workspace/testWebApp001/src/
testApp001.py

<Directory /home/blake/workspace/testWebApp001/src>
Order allow,deny
Allow from all
</Directory>

LogLevel info

</VirtualHost>

--
You received this message because you are subscribed to the Google Groups "WSGI Components" group.
To post to this group, send email to wsgi-co...@googlegroups.com.
To unsubscribe from this group, send email to wsgi-componen...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wsgi-components?hl=en.

Graham Dumpleton

unread,
May 21, 2010, 7:30:10 AM5/21/10
to WSGI Components
Read:

http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Access_Rights_Of_Apache_User

Likely your file/directory permissions aren't correct even if you have
managed to set sys.path correctly.

Also read:

http://code.google.com/p/modwsgi/wiki/WhereToGetHelp

This list isn't the mod_wsgi list and the only thing that ever usually
gets posted here is spam.

Graham
Reply all
Reply to author
Forward
0 new messages