IIS 6 PyISAPIe problems

183 views
Skip to first unread message

shocks

unread,
May 5, 2008, 2:11:13 PM5/5/08
to Django users
Hi

I have followed the Django IIS installation guide on the Django
website but I'm getting the following error when I point to the
helloworld.py example:

Internal Server Error
An error occurred processing this request.

Request handler failed

Traceback (most recent call last):
File "C:\Python25\Lib\Http\Isapi.py", line 42, in Request
imp.load_source(Name, Env.SCRIPT_TRANSLATED).Request
File "\\?\C:\Inetpub\wwwroot\slamprwebsite\helloworld.py", line 1,
in
from django.http import HttpResponse
ImportError: No module named django.http


Additional Information


Module Search Path:

C:\Python25
C:\WINDOWS\system32\python25.zip
C:\Python25\Lib
C:\Python25\DLLs
C:\Python25\Lib\lib-tk
c:\windows\system32\inetsrv

Any ideas. I managed to get this working on another Win 2003 Server
box but not this one.

Thanks
Ben

Adam Fast

unread,
May 5, 2008, 2:33:35 PM5/5/08
to django...@googlegroups.com
Ben,

Where is django? Make sure it's on your pythonpath (or "module search
path" as they appear to be calling it below)

Adam

involatile

unread,
May 5, 2008, 6:04:12 PM5/5/08
to Django users
I'm getting this error. What's missing? Any idea?

===============
Internal Server Error
An error occurred processing this request.

--------------------------------------------------------------------------------

Request handler failed

Traceback (most recent call last):
File "C:\Python25\Lib\Http\Isapi.py", line 42, in Request
imp.load_source(Name, Env.SCRIPT_TRANSLATED).Request
IOError: [Errno 2] No such file or directory
===============

头太晕

unread,
May 6, 2008, 12:58:51 AM5/6/08
to django...@googlegroups.com

involatile

unread,
May 6, 2008, 1:37:49 AM5/6/08
to Django users
I would love to try, but documentation is sketchy. Can someone provide
more detailed instructions?

rcs_comp

unread,
May 10, 2008, 1:20:24 PM5/10/08
to Django users

>
> Traceback (most recent call last):
> File "C:\Python25\Lib\Http\Isapi.py", line 42, in Request
> imp.load_source(Name, Env.SCRIPT_TRANSLATED).Request
> File "\\?\C:\Inetpub\wwwroot\slamprwebsite\helloworld.py", line 1,
> in
> from django.http import HttpResponse
> ImportError: No module named django.http
>
> Additional Information
>
> Module Search Path:
>
> C:\Python25
> C:\WINDOWS\system32\python25.zip
> C:\Python25\Lib
> C:\Python25\DLLs
> C:\Python25\Lib\lib-tk
> c:\windows\system32\inetsrv


Where do you have Django installed? Normally it goes in C:
\Python25\Lib\site-packages. But if you notice in the code above,
that path isn't in the Module Search Path. I also had this problem.
I solved it by moving the Django folder up a level to C:\Python25\Lib.

I know this isn't ideal, but I haven't figure out why the module
search path wouldn't have the site-packages directory in it. When not
using pyisapie, site-packages is in my default search path.

Phillip

unread,
May 10, 2008, 2:56:37 PM5/10/08
to Django users
Hi all, I just got wind of this thread today, and I'll be taking a
look at what is causing this weirdness. I created a group for PyISAPIe
support, and it would help a lot if you could head over there and post
what versions of Django and Python you're using.

http://groups.google.com/group/pyisapie

Thanks,

Phillip

rcs_comp

unread,
May 11, 2008, 3:01:45 AM5/11/08
to Django users
This should fix the problem:

* Make sure the Http module from the PyISAPIe is installed in c:
\Python25\Lib\site-packages
* Stop IIS
* Move PyISAPIe.dll file out of C:\Python25 and into c:\PyISAPIe
(create the directory if you need to)
* Remap the .py handler to the new location of the dll
* Start IIS

Let me know if that doesn't work. It worked for me.

However, this setup will not support multiple installations of
Django. If you want to have multiple Django installations on the same
IIS server, take a look at this thread:

http://groups.google.com/group/pyisapie/browse_thread/thread/b67e861c85e1b26a

You will need to setup Django and PyISAPi for each website (or virtual
directory) with its own application pool.
Reply all
Reply to author
Forward
0 new messages