views:

385

answers:

2

It seems that all roads lead to having to use PyISAPIe to get Django running on IIS6. This becomes a problem for us because it appears you need separate application pools per PyISAPIe/Django instance which is something we'd prefer not to do.

Does anyone have any advice/guidance, or can share their experiences (particularly in a shared Windows hosting environment)?

+1  A: 

Django runs well on any WSGI infrastructure (much like any other modern Python web app framework) and there are several ways to run WSGI on IIS, e.g. see http://code.google.com/p/isapi-wsgi/ .

Alex Martelli
Alex, thanks for replying...I'll take a look.
Kev
+2  A: 

You need separate application pools no matter what extension you use. This is because application pools split the handler DLLs into different w3wp.exe process instances. You might wonder why this is necessary:

Look at Django's module setting: os.environ["DJANGO_SETTINGS_MODULE"]. That's the environment of the process, so if you change it for one ISAPI handler and then later another within the same application pool, they both point to the new DJANGO_SETTINGS_MODULE.

There isn't any meaningful reason for this, so feel free to convince the Django developers they don't need to do it :)

There are a few ways to hack around it but nothing works as cleanly as separate app pools.

Unfortunately, isapi-wsgi won't fix the Django problem, and I'd recommend that you keep using PyISAPIe (disclaimer: I'm the developer! ;)

Phillip Sitbon
Philip - thanks for the insight. Much appreciated.
Kev