IIS7+ Django = :(

144 views
Skip to first unread message

Thiago Galesi

unread,
Aug 5, 2010, 9:28:39 AM8/5/10
to PyISAPIe
Ok, I've been trying, for the past days, to make Django work with
IIS7, and going increasingly frustrated in the process

So even though PyISAPIe is my best bet at the moment, I still can't
get it working

I have some questions that hopefully an get me in the right direction
again

1 - How does PyISAPIe knows which python interpreter to use?
2 - How the .py file (wsgi) should be called in the directory pointed
by IIS
3 - How should PYTHONPATH be set
4 - is there any debug mode or something that can be set? how?

Thanks

Randy Syring

unread,
Aug 5, 2010, 9:55:07 AM8/5/10
to pyis...@googlegroups.com
Thiago,

My only experience has been using this with WSGI. So if you want to
head in that route, here are my thoughts:


> 1 - How does PyISAPIe knows which python interpreter to use?
>

I am not 100% certain on this, but I believe the Python interpreter is
built into the .dll. So, if you want to have 2.5, you have to install
the Py2.5 version of PyISAPIe. If you want 2.6, then the py2.6 version.


> 2 - How the .py file (wsgi) should be called in the directory pointed
> by IIS
>

The file has to be named Isapi.py. See the Isapi.py file in the Django
examples directory on how to set it up.


> 3 - How should PYTHONPATH be set
>

If you are using your system python packages, then you shouldn't need to
alter this. If you have a different directory with packages just for
this web application, then you will need to make sure the path includes
that directory.


> 4 - is there any debug mode or something that can be set? how?

Sorry, not sure on that one.

--------------------------------------
Randy Syring
Intelicom
502-644-4776

"Whether, then, you eat or drink or
whatever you do, do all to the glory
of God." 1 Cor 10:31

Thiago Galesi

unread,
Aug 5, 2010, 10:29:23 AM8/5/10
to PyISAPIe
Randy

Thanks for your insights, I'll try the WSGI route

Because what happens currently is the following:

Error 500.0 Error Code 0x8007007e

My Isapi.py file when executed, first writes to a file, so I think
it's not even being executed (as the file is not there - and yes, it
has permission)

Thanks again

Thiago Galesi

unread,
Aug 5, 2010, 12:07:58 PM8/5/10
to PyISAPIe
Ok, now I get what's wrong. I was using a previous version of PyISAPIe
with python 2.7 :/

Now, with that fixed, I'm getting the "Possible recursion detected"
error

Thiago Galesi

unread,
Aug 5, 2010, 4:47:46 PM8/5/10
to PyISAPIe
And it keeps giving... errors

Now it breaks on win32sysloader *sigh* needed for django-mssql
(exactly on import _win32sysloader)

Running the python executable this works like a charm

*sigh*

Phillip Sitbon

unread,
Aug 5, 2010, 5:49:14 PM8/5/10
to pyis...@googlegroups.com
To answer some questions a little more:

> 1 - How does PyISAPIe knows which python interpreter to use?

The python2x.dll is found just like other dlls. __Usually__ (this
depends on windows version and security settings) it looks in the
PyISAPIe directory first and then in system directories.

Now, for the actual *version* - that's determined by the PyISAPIe DLL,
which is why I provide a different one for each version. I compile and
link to 2.5, 2.6, or (soon) 2.7 separately.

> 2 - How the .py file (wsgi) should be called in the directory pointed by IIS

Randy hopefully pointed you in the right direction there, and right
now the best way to understand how PyISAPIe works is to read those
files.

> 3 - How should PYTHONPATH be set

It shouldn't be necessary to set this (and I am currently
investigating a possible issue with it anyway).

> 4 - is there any debug mode or something that can be set? how?

Only if you compile yourself, but I doubt the information would be
helpful. I tried to design PyISAPIe to give understandable Python
errors and information when it runs properly.


> Now, with that fixed, I'm getting the "Possible recursion detected"
> error

You've configured PyISAPIe to handle a request within a request, this
is usually a result of exactly what is says in the rest of the error
description: you probably did a passthrough with PyISAPIe configured
as an application map instead of a wildcard map.

> Now it breaks on win32sysloader *sigh* needed for django-mssql

Define "breaks" and give me the error you;re seeing, because I don't
have time to debug it myself. I personally consider Django broken to
begin with (and I don't plan to provide direct Django support), so you
need to be more specific.

- Phillip

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

Reply all
Reply to author
Forward
0 new messages