- Get mod_wsgi, you need to have correct version for your Apache and python, in my case, it is:
mod_wsgi-2.3 - Apache 2.2 / Python 2.5
Put the downloaded module into "C:\Program Files\Apache Software Foundation\Apache2.2\modules." - Add following directive into Apache configureation file ("C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf"):
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / "D:/django/mysite/apache/django.wsgi"
<directory "D:/django/mysite">
Order allow,deny
Allow from all
</directory>
<directory "D:/django/mysite/apache>
Order allow,deny
Allow from all
</directory> - Create the file you specified at WSGIScriptAlias above with content:
import os, sys
sys.path.append('D:/django')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler() - Open http://127.0.0.1.
Congratulations on your first Django-powered page.
No comments:
Post a Comment