首页 > 代码库 > django mod_wsgi

django mod_wsgi

版本注意事项

apache2.2

python2.6

django1.6

 

sudo vim /etc/apache2/apache2.conf

WSGIScriptAlias / /var/www/html/mysite/mysite/wsgi.py
<Directory "/var/www/html/mysite">
AllowOverride All
Order deny,allow
Allow from all
</Directory>

Alias /static/ /var/www/html/mysite/mysite/static/
<Directory "/var/www/html/mysite/mysite/static/">
AllowOverride All
Order deny,allow
Allow from all
</Directory>


sudo vim wsgi.py

import os,sys

path=‘/var/www/html/mysite/‘
sys.path.append(path)

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

django mod_wsgi