IIS7 + PyISAPe howto?

99 views
Skip to first unread message

Josh

unread,
May 3, 2010, 12:30:14 PM5/3/10
to PyISAPIe
Hello,

Is there a comprehensive howto for installing Django on PyISAPe +
IIS7?

I read this:

http://geographika.co.uk/setting-up-python-on-iis7

...but it does not address how to configure the PyISAPe handler such
that it handles all requests for a certain URL. So I can get this
working:

http://mysite/HelloWorld.py

...but if I try:

http://mysite/DjangoApp/

...then how does IIS know to use PyISAPe to handle this URL? I tried
setting it as the wildcard handler for * , but when I go to the URL I
get a 403.14 Forbidden (can't list directory contents) error.

Thanks,
-Josh

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

Josh

unread,
May 6, 2010, 9:52:46 AM5/6/10
to PyISAPIe
*Bump*

Randy Syring

unread,
May 6, 2010, 1:41:32 PM5/6/10
to PyISAPIe
Josh,

Have a look at:

http://groups.google.com/group/pyisapie/web/multiple-instances-of-django-on-iis-with-pyisapie?hl=en

Also, a high level overview of what you need to do ...

1) DjangoApp needs to be a virtual directory
2) PyISAPIe needs to be the wildcard handler for that virtual
directory

In the case above, when someone requests:

http://mysite/DjangoApp/

Your app will probably only see "/" in PATH_INFO. IIS doesn't set
some of the path headers as expected when working with virtual
directories, so you will just have to look at what is set and
manipulate if necessary.

If you have specific questions, please post back.

Phillip Sitbon

unread,
May 6, 2010, 4:22:48 PM5/6/10
to pyis...@googlegroups.com
Thanks for responding Randy.

I'd also like to add the fact that, if you're getting a "Forbidden,
can't list directory contents" error, then PyISAPIe is probably doing
its job when/if it can't find a file by passing through to the next
handler, which would be the directory listing module in this case.

Check out the exception handler in the default Isapi.py file where it
does "return True"- if you want to learn more about what's going on,
you can re-raise the exception instead of triggering passthrough.

Cheers,

Phillip

Joshua Kramer

unread,
May 10, 2010, 12:46:27 PM5/10/10
to PyISAPIe

So do I need to create a file such as "django-example.py" with some
driver code, and set that as the default document? (For example, when
I implement a Linux / WSGI based site, there's a 'website.wsgi' file
that contains a bit of Python code that runs the site - and in the
Apache config file I specify that file as the driver.)

On May 6, 4:22 pm, Phillip Sitbon <phillip.sit...@gmail.com> wrote:
> Thanks for responding Randy.
>
> I'd also like to add the fact that, if you're getting a "Forbidden,
> can't list directory contents" error, then PyISAPIe is probably doing
> its job when/if it can't find a file by passing through to the next
> handler, which would be the directory listing module in this case.
>
> Check out the exception handler in the default Isapi.py file where it
> does "return True"- if you want to learn more about what's going on,
> you can re-raise the exception instead of triggering passthrough.
>
> Cheers,
>
> Phillip
>
>
>
> On Thu, May 6, 2010 at 10:41 AM, Randy Syring <rsyr...@gmail.com> wrote:
> > Josh,
>
> > Have a look at:
>
> >http://groups.google.com/group/pyisapie/web/multiple-instances-of-dja...

Randy Syring

unread,
May 10, 2010, 1:05:38 PM5/10/10
to PyISAPIe
You setup your environment and WSGI application in Isapi.py. See the
folder layout here:

http://pyisapie.googlegroups.com/web/Isapi.py%20%28modified%20for%20Django%20WSGI%29?hl=en&hl=en

And take a look at the linked Isapi.py file. I haven't used PyISAPIe
in a bit, so I don't have a recent example.

I believe that PyISAPIe is going to load Isapi.py and get the value
from Request() to us as the application to serve. Philip, please
correct me if I am wrong on that.
Reply all
Reply to author
Forward
0 new messages