I have been sold on mod_wsgi and apache rather than mod_python. I have all the parts installed (django, apache, mod_wsgi) but have run into a problem deploying.
我在osx 10.5上使用apache 2.2和django 1.0b2,mod_wsgi-2.3
我的应用程序叫tred。
Here are the relevant files: httpd-vhosts (included in httpd-conf)
NameVirtualHost tred:80 ServerName tred Alias /admin_media /usr/lib/python2.5/site-packages/django/contrib/admin/media Order allow,deny Allow from all Alias /media /Users/dmg/Sites/tred/media Order allow,deny Allow from all Alias / /Users/dmg/Sites/tred/ Order allow,deny Allow from all WSGIScriptAlias / /Users/dmg/Sites/tred/mod_wsgi-handler.wsgi WSGIDaemonProcess tred user=dmg group=staff processes=1 threads=10 WSGIProcessGroup tred
mod_wsgi-handle.wsgi模式
import sys import os sys.path.append(os.path.dirname(os.path.abspath(__file__)) + /.. ) os.environ[ DJANGO_SETTINGS_MODULE ] = tred.settings import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
当我转到http://tred我得到的是目录列表,而不是渲染的网站。我认为我已经正确地遵循了教程,但显然是不对的。我能做些什么来让它发挥作用?