- PyISAPIe is an ISAPI extension which can be downlod from here . Download the latest extension according to installed python version.
- Just make sure that ISAPI and ISAPI filters has been installed on IIS (During IIS installation these two component should have checked).
- Copy PyISAPIe.dll file and Http folder into your Django website project.Example:
- Suppose your website folder path is: "C:\Python25\Lib\site-packages\MySite"
- "C:\Python25\Lib\site-packages\MySite\PyISAPIe.dll" and "C:\Python25\Lib\site-packages\MySite\Http" will be the result.
- Right click on site folder "C:\Python25\Lib\site-packages\MySite" click on properties. On properties window choose the security tab then click on Edit then Add and choose the "Network Service"
- Do the same procedure for the Django folder: "C:\Python25\Lib\site-packages\django"
- If the setting file is"C:\Python25\Lib\site-packages\MySite\settings.py" and site-packages is on your path then you should set: os.environ["DJANGO_SETTINGS_MODULE"] = "MySite.settings"
- Current version has been compiled on x86-32-bit platform. You need to install x86 python version so this extension can work. Otherwise, you need to compile it from source for 64-bit platform.
- "Http" folder name is case-sensitive do not change the name.
- I have compiled PyISAPIe on 64 bit python 2.7. Files are available on this post to download.
- For deploying the 64-bit PyISAPIe.dll on IIS and django, after downloading the file, follow these instructions.
- Copy the folder to drive C.
- Give the 'Network Service' permission to the folder .
- From Example\Django copy the Isapi.py and DjangoMap.py to Http folder
- Edit the Isapi.py and add your website settings
- Now from IIS add the PyISAPIe.dll to Handler Mapping as Script Map. Make sure on the ordered list view it is located at the top of list.
- On 'Application pools' advance settings make sure that "Enable 32-Bit Aplications" is set to False and "Identity" is Network Service.
- Do a recycle and enjoy!
For more information you can check out PyISAPIe project HomePage.