- Does apache use the virtualenv's environment?
- Mod_wsgi: does that use the correct python version? mod_wsgi normally
uses /usr/bin/python (python 2.5 or 3.2 whatever) and you might have
used /usr/bin/python2.7.
- Can the apache process find the mysql libraries? Are the environement
variables different? Try printing "os.environ" from your .wsgi script
for instance.
Just some brainstorming.
Reinout
--
Reinout van Rees http://reinout.vanrees.org/
rei...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"
/Library/Frameworks/Python.framework//Versions/2.7/bin/python
/usr/bin/python2.5
/usr/bin/python2.6
/usr/bin/pythonw2.5
/usr/bin/pythonw2.6
/usr/local/bin/python
/usr/local/bin/python-32
/usr/local/bin/python2.7
/usr/local/bin/python2.7-32
/usr/local/bin/python3
/usr/local/bin/python3-32
/usr/local/bin/python3.2
/usr/local/bin/python3.2-32
/usr/local/bin/python3.2m
/usr/local/bin/pythonw
/usr/local/bin/pythonw-32
/usr/local/bin/pythonw2.7
/usr/local/bin/pythonw2.7-32
/usr/local/bin/pythonw3
/usr/local/bin/pythonw3-32
/usr/local/bin/pythonw3.2
/usr/local/bin/pythonw3.2-32
On 23-08-11 00:37, Jim wrote:
This probably has been discussed many times, but I still can't find any
solution yet. Basically, it turns out that python can load MySQLdb just
fine, but Apache can't load MySQLdb from the wsgi script.
- Does apache use the virtualenv's environment? And this is what I got from 'print os.environ' in the .wsgi file.
- Mod_wsgi: does that use the correct python version? mod_wsgi normally uses /usr/bin/python (python 2.5 or 3.2 whatever) and you might have used /usr/bin/python2.7.
- Can the apache process find the mysql libraries? Are the environement variables different? Try printing "os.environ" from your .wsgi script for instance.
Just some brainstorming.
Reinout
--
Reinout van Rees http://reinout.vanrees.org/
rei...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Look in /etc/apache2/mods-enabled/wsgi.load (that's on ubuntu, your
mod_wsgi config file might be somewhere else. On one of my older servers
it contains:
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so-2.5
Which means it is a python2.5 mod_wsgi. In ubuntu's case, as it is in
/usr/lib, it means that it uses the system python2.5.
Your python dirs look like this:
> /usr/local/bin/python
>
> /usr/local/bin/python-32
>
> /usr/local/bin/python2.7
That's all locally compiled by hand. There's no way I can tell you which
one of 'em is used by apache :-) But probably what you'd get when
calling "python2.7" if your wsgi config indicates it is for 2.7.
You got your wsgi script to print the environment
>'PATH':
> '/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/opt/local/bin:/opt/local/sbin:/Users/jianbao/shlib:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/usr/X11/bin:/Users/jianbao/pylib:/usr/local/mysql/bin',
Wow! That's a lot of custom stuff in there, including multiple python
paths. To me, it looks like pure luck if it is able to find the correct
mysql in there :-)
But what I was looking for: virtualenv puts the bin directory of the
virtualenv in the path. I don't see anything that looks like a
virtualenv dir in there, unless it is the /Users/jianbao/pylib at the end.
I personally don't know how wsgi+virtualenv works together (I use
buildout normally). so you'll have to ask around for that.
Are mysql, python and python-mysql all compiled correctly for the same
architecture? IE all 32 bit or all 64 bit.
ISTR that this can be a problem on OS X, but I'm not an OS X user...
http://stackoverflow.com/questions/1969222/mysql-python-1-2-3-and-os-x-10-5-64-or-32-bit
Cheers
Tom
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.