Django Development with IIS: Difference between revisions
(Created page with "== Overview == Information about setting up Django projects on IIS. == Prerequisites == === BitNami Django Stack === The [http://bitnami.org/stack/django BitNami Django S...") |
(No difference)
|
Revision as of 16:09, 20 February 2013
Overview
Information about setting up Django projects on IIS.
Prerequisites
BitNami Django Stack
The BitNami Django Stack is a bundle of installers for the whole environment necessary to run Django on a Windows server. It includes Python, MySQL, PostgreSQL, an Apache server, and Django.
The installation prompts for a port number to use for the Apache server. 8080 is commonly used.
The Apache server can then be reached with `http://localhost:8080. Or, after opening the port in Windows Firewall, the server can be reached on the LAN with http://[MACHINE_NAME]:8080 or http://[LOCAL_IP]:8080`.
Changing the Apache server port number
To change the port number of the Apache server after installation:
- Edit the
Listenvalue in the[DJANGO_INSTALL_ROOT]/apache2/conf/httpd.conffile. - Restart the server.
- (Windows Start Menu > BitNami DjangoStack > Manager Tool > Apache Web Server > Restart)
Accessing projects
For each Django Project:
- Create a WSGI application script file named
projectName.wsgiin[DJANGO_INSTALL_DIR]/appls/django/conf.
import os, sys
sys.path.append('/path/to/your/django/projects/folder')
sys.path.append('/path/to/your/project/folder')
os.environ['DJANGO_SETTINGS_MODULE'] = 'projectName.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Source: BitNami Django Stack Wiki: How to Start a Django Project?