Running a Django Application on IIS: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
Line 12: Line 12:
* Install `pip` ([http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip These installers] worked well)
* Install `pip` ([http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip These installers] worked well)
* Install Django using pip: `pip install django`<br />''Trying to use the BitNami Django Stack caused ImportExport errors when running `python manage.py collectstatic`: "no django.core.management module".)''
* Install Django using pip: `pip install django`<br />''Trying to use the BitNami Django Stack caused ImportExport errors when running `python manage.py collectstatic`: "no django.core.management module".)''
* pywin32 - Python extensions for Windows


== Setting up a virtualenv under Windows ==
== Setting up a virtualenv under Windows ==

Revision as of 16:24, 16 April 2013

Overview

How to get a Django project hosted on an IIS server.

django-windows-tools

django-windows-tools

Prerequisites

  • Install Python 2.7 from the main distribution found after searching for "Windows python"
  • Install pip (These installers worked well)
  • Install Django using pip: pip install django
    Trying to use the BitNami Django Stack caused ImportExport errors when running python manage.py collectstatic: "no django.core.management module".)
  • pywin32 - Python extensions for Windows

Setting up a virtualenv under Windows

  • Running the command virtualenv my-proj-env --no-site-packages I was running into this error:
AssertionError: Filename c:\Python27\Lib\os.py does not start with any of these prefixes: ['c:\\python27']
  • There were two useful bits of advice in the Stackoverflow thread:
  • The path values stored in the PYTHONPATH environment variable need to match the case of the path at the end of the error message.
    In my case both the drive letter and the "p" in "python" were lowercase and all the paths needed to match, i.e. both the "c" and "p" needed to be lowercase even though the directory name was actually capitalized.
  • Once that error was resolved, I got the following
ImportError: No module named _socket
  • Which was resolved by adding "c:\python27\DLLs" to the PYTHONPATH environment variable.

See also