I have been trying to setup Django to work on IIS 7 Enterprise (Version 6.1 on Windows 7), but so far have been unable to. I am using Django 1.8.3 and Python 2.7. I am using PyISAPI to run Django on IIS. I have tried both the 2.6 version of PyISAPI and the 2.7 version (http://blog.wolfplusplus.com/?attachment_id=276). I have followed the following tutorials:
IIS Not Linking to Django with PyISAPIe
http://blog.wolfplusplus.com/?p=272
I have followed others also, and all of them do slightly different things. None of them have worked with me so far, and all of the tutorials seems to be a couple of years old. Can someone provide a straightforward up to date guide on how to setup Django 1.8 (running with Python 2.7) with IIS. There seems to be multiple approaches such as using FastCGI, but I have read that PyISAPI is much faster than FastCGI. My goal is to run a Django application on IIS.
Django is a framework which has its own URL routing, so Django apps must be installed as a “handler” in IIS for specific paths. To install a Django app on the IIS's Default Web Site, select it in the management console, and open the Handler mappings configuration feature.
Insure you have CGI installed on your IIS: Go to Start -> Control Panel -> Programs and Features -> on the left hand side, go to "Turn Windows Features on or off" -> Under the IIS node, make sure CGI is installed: Download Python for Windows, from python.org (doesn't matter 2.7 or python 3, depends on your preference).
I've just followed that guide with following corrections:
DJANGO_SETTINGS_MODULE
, underscores were eaten by markupand everything worked fine! If it's not applicable in your case please provide some additional details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With