apache_django_wsgi.conf的内容为:
Alias /site_media/ "d:/works/web/myweb/media/"
<Directory "d:/works/web/myweb/media">
Order allow,deny
Options Indexes
Allow from all
IndexOptions FancyIndexing
</Directory>
Alias /media/ "D:/Sources/Library/django/django/contrib/admin/media/"
<Directory "D:/Sources/Library/django/django/contrib/admin/media">
Order allow,deny
Options Indexes
Allow from all
IndexOptions FancyIndexing
</Directory>
WSGIScriptAlias / "d:/works/web/myweb/apache/django.wsgi"
<Directory "d:/works/web/myweb/apache">
Allow from all
</Directory>
django.wsgi的内容为:
import os, sys
#Calculate the path based on the location of the WSGI script.
apache_configuration= os.path.dirname(__file__)
project = os.path.dirname(apache_configuration)
workspace = os.path.dirname(project)
sys.path.append(workspace)
os.environ['DJANGO_SETTINGS_MODULE'] = 'myweb.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
print >> sys.stderr, sys.path
然后启动apache的web服务器,输入http://localhost就会出现Django的欢迎页面