Re: Cannot import a module when deployed in Apache WSGI

2010-06-17 Thread Graham Dumpleton


On Jun 17, 6:28 pm, Dmitry Dulepov  wrote:
> Hi!
>
> Radhakrishna wrote:
> > I have deployed my django project to Apache using mod_wsgi. In urls.py
> > I am mapping "gateway/" to gateway.py which imports 'pyamf' module.
> > The problem is, even though pyamf module is in python path, its not
> > able to find it. I can import it from command line and when in django
> > development server.
>
> Have a look to Python path (I shortened it for you):
>
> > Python Path:       [ ... 'D:\\Python2.6\\Lib\\site-
> > packages\\pyamf']
>
> Pythin will be looking for D:\\Python2.6\\Lib\\site-packages\\pyamf\\pyamf.
> Does this directory exist?
>
> Normally, your 'site-packed' should in Python path, not its subdirectories.

Your last comment is generally correct, but the search path also
listed:

  'D:\\Python2.6\\lib\\site-packages'

Although 'lib' is in lower case, that shouldn't usually matter on
Windows.

>From the command line Python they should go:

  import pyamf
  print pyamf.__file__

to find out where it is being imported from and post that.

They should also check the permissions on directory pyamf is in in
case it has restrictive permissions of user that user that Apache runs
as cant read.

Graham

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-us...@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.



Re: Cannot import a module when deployed in Apache WSGI

2010-06-17 Thread Dmitry Dulepov
Hi!

Radhakrishna wrote:
> I have deployed my django project to Apache using mod_wsgi. In urls.py
> I am mapping "gateway/" to gateway.py which imports 'pyamf' module.
> The problem is, even though pyamf module is in python path, its not
> able to find it. I can import it from command line and when in django
> development server.

Have a look to Python path (I shortened it for you):

> Python Path:  [ ... 'D:\\Python2.6\\Lib\\site-
> packages\\pyamf']

Pythin will be looking for D:\\Python2.6\\Lib\\site-packages\\pyamf\\pyamf.
Does this directory exist?

Normally, your 'site-packed' should in Python path, not its subdirectories.

-- 
Dmitry Dulepov
Twitter: http://twitter.com/dmitryd/
Web: http://dmitry-dulepov.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.



Re: Cannot import a module when deployed in Apache WSGI

2010-06-17 Thread Radhakrishna Bhat
Any py gurus?

On Wed, Jun 16, 2010 at 8:42 PM, Radhakrishna wrote:

> This may be very silly, but I cant figure out the problem. Everything
> seems to be in place.
> I have deployed my django project to Apache using mod_wsgi. In urls.py
> I am mapping "gateway/" to gateway.py which imports 'pyamf' module.
> The problem is, even though pyamf module is in python path, its not
> able to find it. I can import it from command line and when in django
> development server.
>
> ViewDoesNotExist at /gateway/
> Could not import TestProject.gateway. Error was: No module named pyamf
> Request Method: GET
> Request URL:http://localhost/dj/gateway/
> Django Version: 1.2.1
> Exception Type: ViewDoesNotExist
> Exception Value:
> Could not import TestProject.gateway. Error was: No module named pyamf
> Exception Location: D:\Python2.6\lib\site-packages\django\core
> \urlresolvers.py in _get_callback, line 134
> Python Executable:  C:\Program Files\Apache Software Foundation
> \Apache2.2\bin\httpd.exe
> Python Version: 2.6.0
> Python Path:['D:\\Python2.6\\python26.zip', 'D:\\Python2.6\\Lib', 'D:\
> \Python2.6\\DLLs', 'D:\\Python2.6\\Lib\\lib-tk', 'C:\\Program Files\
> \Apache Software Foundation\\Apache2.2', 'C:\\Program Files\\Apache
> Software Foundation\\Apache2.2\\bin', 'D:\\Python2.6', 'D:\\Python2.6\
> \lib\\site-packages', 'D:/DjangoProjects', 'D:\\Python2.6\\Lib\\site-
> packages\\pyamf']
> Server time:Wed, 16 Jun 2010 20:37:57 +0530
>
> Any idea whats going on? As you can see, pyamf is in python path.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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.