分类: Python/Ruby
2013-12-25 17:19:18
ServerName 203.com
ServerAlias
ServerAdmin
DocumentRoot /var/www/html/blog_zzx/
WSGIScriptAlias / /var/www/html/blog_zzx/blog/mod.wsgi
Order allow,deny
Allow from all
# Alias /robots.txt /srv/www/ducklington.org/public_html/robots.txt
# Alias /favicon.ico /srv/www/ducklington.org/public_html/favicon.ico
# Alias /images /srv/www/ducklington.org/public_html/images
# Alias /static /srv/www/ducklington.org/public_html/static
ErrorLog /var/www/html/blog_zzx/error.log
CustomLog /var/www/html/blog_zzx/access.log combined
========================================================
wsgi配置
wsgi存放路径要与apache的一致
如: WSGIScriptAlias / /var/www/html/blog_zzx/blog/mod.wsgi
================================================
#_*_coding:utf_8_*_
import os,sys
sys.path.append('/var/www/html/blog_zzx')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
====================================================
如果此过程中出现
返回500错误
需要把wsgi配置文件中的:
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' 与
settings.py的
ROOT_URLCONF = 'urls' 写成这样