Running a Django Application on IIS: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
(Created page with "== Overview == How to get a Django project hosted on an IIS server. == django-windows-tools == [http://django-windows-tools.readthedocs.org/en/latest django-windows-tools]...")
 
Line 28: Line 28:
</pre>
</pre>
::* Which was resolved by adding "c:\python27\DLLs" to the `PYTHONPATH` environment variable.
::* Which was resolved by adding "c:\python27\DLLs" to the `PYTHONPATH` environment variable.
== See also ==
* [[Django Development with IIS]]


[[Category:Django]] [[Category:Python]] [[Category:IIS]] [[Category:Web Development]]
[[Category:Django]] [[Category:Python]] [[Category:IIS]] [[Category:Web Development]]

Revision as of 15:43, 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".)

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