pythondjangoiis-6pyisapie

Do I need PyISAPIe to run Django on IIS6?


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)?


Solution

  • 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! ;)