I am currently trying to install Django on a Mediatemple DV (4.0) server 
and have the installation be within a virtualenv.  The django app will be 
run from a subdomain, *parts.domain.com*, while the root domain *domain.com* is 
serving a wordpress site.

I have django installed inside the virtualenv at *
/var/www/vhosts/domain.com/parts/env/* The virtual environment is *'env'.  *The 
server is running python 2.4.3, but I needed at least 2.6, so I installed 
2.6 inside the virtual env and that worked perfectly for setting up the 
initial django site.  Now the problem comes with the running of django.

I created a vhost.conf file under */var/www/vhosts/parts.domain.com/conf*
*
*
    <Location "/">
       SetHandler python-program
        PythonPath "['/var/www/vhosts/domain.com/parts/env/bin', 
'/var/www/vhosts/domain.com/parts/env/store'] + sys.path"
        PythonHandler virtualproject
        SetEnv DJANGO_SETTINGS_MODULE store.settings
    </Location>

 The path to virtualproject, referenced in the PythonHandler line, is 
*/var/www/vhosts/domain.com/parts/env/bin/virtualproject.py. 
 *

The contents of that file are:

*activate_this = '/var/www/vhosts/domain.com/parts/env/bin/activate_this.py'
*
*execfile(activate_this, dict(__file__=activate_this))*
*
*
*from django.core.handlers.modpython import handler*
*
*
The activate_this.py file is the one that comes with the virtualenv 
installation

When I go to the site *parts.domain.com*, I get the following error in the 
apache logs:

[Thu Mar 14 17:29:45 2013] [error] [client ] PythonHandler virtualproject: 
Traceback (most recent call last):
[Thu Mar 14 17:29:45 2013] [error] [client ] PythonHandler virtualproject: 
  File "/usr/lib64/python2.4/site-packages/mod_python/apache.py", line 287, 
in HandlerDispatch\n    log=debug)
[Thu Mar 14 17:29:45 2013] [error] [client ] PythonHandler virtualproject: 
  File "/usr/lib64/python2.4/site-packages/mod_python/apache.py", line 464, 
in import_module\n    module = imp.load_module(mname, f, p, d)
[Thu Mar 14 17:29:45 2013] [error] [client ] PythonHandler virtualproject: 
  File "/var/www/vhosts/domain.com/parts/env/bin/virtualproject.py", line 
4, in ?\n    from django.core.handlers.modpython import handler
[Thu Mar 14 17:29:45 2013] [error] [client ] PythonHandler virtualproject: 
ImportError: No module named django.core.handlers.modpython

I can only think that this is happening because apache is attempting to use 
the system default python2.4 instead of the one in my virtualenv where 
django is installed.  How do I fix this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to