Django is a popular Python web framework, below is how to use IIS(Internet Information Service) to host Django application on Windows.

  • Install Python on Windows
  • Create a python virtual environment so your future development won’t rely on existing Python executables on your Windows.(This is not really necessary as most Windows on PC is not a multi-user operating system anyway but keep this as a best practice)
cd c:\work\python\qlik_venv
python –m venv venv
  • Activate the venv
cd venv
  • Install Django
pip install django
  • Create a project
django-admin  startproject qlikua
  • Create an app at the top level
python startapp qlikua_app

Once the above is done, you should have file structure similar to below







Test everything is working so far by using Django’s own web server(python runserver), you can follow this Django article for great details.

Now it’s now for IIS

  • Install wfastcgi, which is provided/supported by Microsoft(this is an article on this module). Remember to keep your venv activated.
pip install wfastcgi
  • Configure fast cgi at IIS level
    1. Create a FastCGI entry






















2. Create a site












3. Add the following in “Application Settings”. Note WSGI_HANDLER is a variable “application” created by file qlikua\















4. Add an entry in “Hander Mappings” (Add Module Mapping…), after this a web.config will be created under qlik_venv\qlikua













5. Review web.config which was created by the above, you can modify those variables manually

















  • Start the site and view the app in a browser

p.s  A very detailed step-by-step post for running Django on IIS

Running a Django application on IIS
Tagged on:             

Leave a Reply

Your email address will not be published.

7 + 3 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.