What does your Apache vhost config look like? You will need to add a
WSGIDaemonProcess directive where you can specify the python path for the
virtual environment, like so:

WSGIDaemonProcess processname user=wsgi group=apache processes=1 threads=10
umask=0022 display-name=displayname
python-path=/data/app/guillem-py3-dj17-test/lib64/python3.3/site-packages/

---------
Brad Pitcher


On Fri, May 2, 2014 at 4:11 AM, Guillem Liarte <
[email protected]> wrote:

> Hello,
>
> I have looked through the web in several different especialised forums but
> I cannot find the way to do this properly.
>
> My aim is to have an environment to host Django applications running
> Centos 6. So far I have managed to:
>
> - Get Centos 6.5 + Ptython 3.3.2 + Django 1.6 (virtual env), running a
> test application using python's webserver. Time to move into Apache.
> - I manage to get it working from Apache but instead of Python 3.3.2, it
> uses the Python 2.6 installed in the system. No matter if I launch apache
> from the virtual environment, even once I have enabled python3.
>
> I know Djanog 1.6 can use python 2.6. But that is not what i want to
> achieve, as 1.7 will not.
>
> Just to give some idea of what I have installed:
>
>
>
> In the system:
> python --version
> Python 2.6.6
>
> From RedHat SCL:
>
> source /opt/rh/python33/enable
>
> python --version
> Python 3.3.2
>
> Inside the virtual environment I have:
>
> Django (1.6.3)
> pip (1.4.1)
> setuptools (0.9.8)
>
> That starts successfully:
>
> python manage.py runserver 192.168.0.16:8000
>
>
>
> Starting development server at http://192.168.0.16:8000/
>
> Quit the server with CONTROL-C.
>
> When getting to admin or any error page:
>
> Django Version:
>       1.6.3
> Python Version:
>       3.3.2
>
> Python Path:
>
>
> ['/data/app/guillem-py3-dj17-test/guillem_test',
>  '/data/app/guillem-py3-dj17-test/lib64/python33.zip',
>  '/data/app/guillem-py3-dj17-test/lib64/python3.3',
>  '/data/app/guillem-py3-dj17-test/lib64/python3.3/plat-linux',
>  '/data/app/guillem-py3-dj17-test/lib64/python3.3/lib-dynload',
>  '/opt/rh/python33/root/usr/lib64/python3.3',
>  '/opt/rh/python33/root/usr/lib/python3.3',
>  '/data/app/guillem-py3-dj17-test/lib/python3.3/site-packages']
> _______________
>
>
> When starting this from Apache 2.2 instead of the python embedded server:
>
>
> httpd -k restart -e debug
>
>
> ...
> [Fri May 02 11:53:29 2014] [debug] mod_so.c(246): loaded module wsgi_module
> ...
>
> The Apache service starts in my port of choice:
>
> tcp        0      0 192.168.0.16:8082           0.0.0.0:*                   
> LISTEN      1676/httpdWhat I get now is:
>
>
> So now I get:
>
> Django Version:       1.6
> Python Executable:    /data/app/guillem-py3-dj17-test/bin/python
> Python Version:       2.6.6
> Python Path:  
>
> ['/data/app/django-test/dev/test-1/HELLO_WORLD/lib/python2.6/site-packages',
>
>
>  '/data/app/django-test/dev/test-1/HELLO_WORLD/HELLO_WORLD/..',
>  '/usr/lib64/python26.zip',
>  '/usr/lib64/python2.6',
>  '/usr/lib64/python2.6/plat-linux2',
>  '/usr/lib64/python2.6/lib-tk',
>
>
>  '/usr/lib64/python2.6/lib-old',
>  '/usr/lib64/python2.6/lib-dynload',
>  '/usr/lib64/python2.6/site-packages',
>  '/usr/lib64/python2.6/site-packages/gst-0.10',
>  '/usr/lib64/python2.6/site-packages/gtk-2.0',
>
>
>  '/usr/lib/python2.6/site-packages',
>  '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info',
>  '/data/app/django-test/dev/test-1/virtual/lib/python3.3/site-packages',
>  '/data/app/django-test/dev/test-1/HELLO_WORLD/']
>
>
>
> Just to make it clear, that python inside the virtual env is python 3.3.2:
>
> (guillem-py3-dj17-test)ndoluxel002:/data/app/guillem-py3-dj17-test/bin# pwd
> /data/app/guillem-py3-dj17-test/bin
> (guillem-py3-dj17-test)ndoluxel002:/data/app/guillem-py3-dj17-test/bin# which 
> python
>
>
> /data/app/guillem-py3-dj17-test/bin/python
> (guillem-py3-dj17-test)ndoluxel002:/data/app/guillem-py3-dj17-test/bin# 
> ./python --version
> Python 3.3.2
>
>
>
> ____
>
>
> So, for some reason which most possibly lies with a misconfiguration from my 
> part, Apache ignores the fact that theer is another python installed in the 
> system.
>
>
> I believe this happens because the installed mod_wsgi is not compatible:
>
>
> mod_wsgi-3.2-3.el6.x86_64
>
> Is this the case?
>
>
>
>
> For whatI read here:
>
> http://code.google.com/p/modwsgi/wiki/SupportForPython3X
>
> I should be fine with mod_wsgi 3.2
>
> ___________________
>
>
> What I have tried:
>
> - Install apache 2.4 alongside 2.2. Even if I can get a suitable mod_wsgi
> mod, I get library dependancy problems, one with python 2.7, which should
> be solvable, and another for glibc, which may be more triky.
>
> All, in it looks like Centos 6.5 + Python 3.3.X + Django 1.6 is not
> possible for the moment.
>
> Am I right?
>
> If there is a way, please let me know!
>
> Many thanks in advance.
>
>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/aab4ab40-d466-4903-b75d-8a99285cad3f%40googlegroups.com<https://groups.google.com/d/msgid/django-users/aab4ab40-d466-4903-b75d-8a99285cad3f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMFpZriG5X6i%3DxRYPtc3is0FSVVpKVbuCciVsjwZLE7398q5XA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to