abden003
abden003

Reputation: 1335

Setting up Django on IIS

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.

Upvotes: 10

Views: 1281

Answers (1)

cyberj0g
cyberj0g

Reputation: 3787

I've just followed that guide with following corrections:

  1. You should give permission on the site folder to App Pool's identity. I just went to App Pool's Advanced Settings > Process model > Identity and set it to local admin account for testing purposes.
  2. Correct environment variable name in step 4.13 is DJANGO_SETTINGS_MODULE, underscores were eaten by markup

and everything worked fine! If it's not applicable in your case please provide some additional details.

Upvotes: 6

Related Questions