Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Cannot import a module when deployed in Apache WSGI [RSS Feed]

#1 June 16, 2010 16:14:43

R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Cannot import a module when deployed in Apache WSGI


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:
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 June 17, 2010 09:23:33

Radhakrishna B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Cannot import a module when deployed in Apache WSGI


Any py gurus?

On Wed, Jun 16, 2010 at 8:42 PM, Radhakrishna <radhakrishn...@gmail.com>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:
> 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<django-users%2bunsubscr...@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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 June 17, 2010 09:28:32

Dmitry D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Cannot import a module when deployed in Apache WSGI


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:

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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 June 17, 2010 09:59:32

Graham D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Cannot import a module when deployed in Apache WSGI


On Jun 17, 6:28 pm, Dmitry Dulepov <dmitry.dule...@gmail.com> 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:      
>
> 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 athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » Cannot import a module when deployed in Apache WSGI [RSS Feed]

Board footer

Moderator control

Enjoy the 15th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support