The running django on xampp can be divided into two steps.
- Step 1 : install wsgi and check if everything is OK
- follow the steps in the answer of this post - Setting Python Path in Windows XAMPP using WSGI
- Step 2 : install and run django
- run easy_install django to install django on PC
- test django
- follow the example in "http://docs.djangoproject.com/en/dev/intro/tutorial01/"
- I assume the generated django code is in C:\xampp\htdocs\django\mysite
- Make the mysite.wsgi in C:\xampp\htdocs\wsgi\scripts
mysight.wsgi
import os
import sys
mysite = r'C:/xampp/htdocs/django'
if mysite not in sys.path:sys.path.insert(0,mysite)
mysite = r'C:/xampp/htdocs/django/mysite'
if mysite not in sys.path:sys.path.insert(0,mysite)
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
- You can add WSGIScriptAlias /mysite "C:/xampp/htdocs/wsgi/scripts/mysite.wsgi" in wsgi.conf to run http://YOURSITE/mysite, or you can just run http://YOURSITE/wsgi/mysite.wsgi
- Relaunch apache if necessary.