On Feb 4, 7:47 pm, Brett Epps <brett.e...@quest.com> wrote:
> Sometimes it can help to print sys.path in your WSGI file.  (The output
> should end up in the apache error log.)  That should tell you where Python
> is looking for modules.  If the Django install path is not listed, you may
> need to reinstall Django.

It's exactly the same sys.path I get from command line python, where
the import works.

>From the apache error log:

['/usr/lib/python2.6/site-packages/python_dateutil-1.5-py2.6.egg', '/
usr/lib/python26.zip', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-
linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/
usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/site-packages', '/
usr/lib/python2.6/site-packages/gst-0.10', '/usr/lib/python2.6/site-
packages/gtk-2.0', '/usr/lib/python2.6/site-packages/setuptools-0.6c11-
py2.6.egg-info', '/usr/lib/python2.6/site-packages/webkit-1.0']

$ python
Python 2.6.6 (r266:84292, Dec  7 2011, 20:38:36)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', '/usr/lib/python2.6/site-packages/python_dateutil-1.5-py2.6.egg',
'/usr/lib/python26.zip', '/usr/lib/python2.6', '/usr/lib/python2.6/
plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-
old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/site-
packages', '/usr/lib/python2.6/site-packages/gst-0.10', '/usr/lib/
python2.6/site-packages/gtk-2.0', '/usr/lib/python2.6/site-packages/
setuptools-0.6c11-py2.6.egg-info', '/usr/lib/python2.6/site-packages/
webkit-1.0']


> How was Django installed originally?

django was install from svn like this:

#svn co http://code.djangoproject.com/svn/django/trunk/django /usrl/
lib/python2.6/dist-packages/django
#ln -s /usrl/lib/python2.6/dist-packages/django /usr/lib/python2.6/
site-packages/django

Which is the same way I've done it on the other systems I've deployed
this app on.

mod_wsgi was installed with yum.

Thanks!
-larry

> Brett
>
> On 2/4/12 6:53 PM, "larry.mart...@gmail.com" <larry.mart...@gmail.com>
> wrote:
>
> >I am trying to deploy my django app on a newly setup CentOS box. I
> >have successfully deployed it on ubuntu and on a Mac.
>
> >I get these errors in the apache error log:
>
> >[Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] mod_wsgi
> >(pid=13616): Target WSGI script '/usr/local/myapp/scripts/myapp.wsgi'
> >cannot be loaded as Python module.
> >[Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] mod_wsgi
> >(pid=13616): Exception occurred processing WSGI script '/usr/local/
> >myapp/scripts/myapp.wsgi'.
> >[Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] Traceback (most
> >recent call last):
> >[Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1]   File "/usr/
> >local/myapp/scripts/myapp.wsgi", line 8, in <module>
> >[Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1]     import
> >django.core.handlers.wsgi
> >[Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] ImportError: No
> >module named django.core.handlers.wsgi
>
> >From command line python the import works:
>
> >$ python
> >Python 2.6.6 (r266:84292, Dec  7 2011, 20:38:36)
> >[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
> >Type "help", "copyright", "credits" or "license" for more information.
> >>>> import django.core.handlers.wsgi
>
> >I also have this warning in the apache log:
>
> >[Sat Feb 04 17:41:12 2012] [warn] mod_wsgi: Compiled for Python/2.6.2.
> >[Sat Feb 04 17:41:12 2012] [warn] mod_wsgi: Runtime using Python/
> >2.6.6.
>
> >I've checked permissions, and wsgi.py and every dir in the path to it
> >is 755.
>
> >Anyone know why my app isn't finding it?
>
> >TIA!
> >-larry
>
> >--
> >You received this message because you are subscribed to the Google Groups
> >"Django users" group.
> >To post to this group, send email to django-users@googlegroups.com.
> >To unsubscribe from this group, send email to
> >django-users+unsubscr...@googlegroups.com.
> >For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

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

Reply via email to