I'm using Ubuntu 10.04.
I create a django project under /home/wong2/Code/python/django2/
named atest
and create a wsgi file setting.wsgi
in the same directory
Here is the content of setting.wsgi
:
import os
import sys
path = '/home/wong2/Code/python/django2'
if path not in sys.path:
sys.path.append(path)
os.environ["DJANGO_SETTINGS_MODULE"] = "atest.settings"
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()
and here is what I add to my my httpd.conf:
<VirtualHost *:80>
ServerName localhost
WSGIScriptAlias / /home/wong2/Code/python/django2/setting.wsgi
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
<Directory "/home/wong2/Code/python/django2/atest">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
The problem is, when I visit http://localhost, it says
Forbidden
You don't have permission to access /
on this server.
Thanks a lot.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…