1.
475 brew tap homebrew/apache
476 brew install mod_wsgi
477 ls /usr/local/Cellar/mod_wsgi/4.5.7/libexec/mod_wsgi.so
478 sudo vi /etc/apache2/httpd.conf
2.
wsgi.py
import sys
sys.path.append(‘/Library/WebServer/Documents/blog‘)
setting.py
INSTALLED_APPS = [
‘django.contrib.admin‘,
‘django.contrib.auth‘,
‘django.contrib.contenttypes‘,
‘django.contrib.sessions‘,
‘django.contrib.messages‘,
‘django.contrib.staticfiles‘,
‘django.contrib.sites‘,
‘django.contrib.flatpages‘,
‘django.contrib.sitemaps‘,
‘django_comments‘,
‘rest_framework‘,
‘corsheaders‘,
‘snippets‘,
‘blogpost‘,
‘blog‘
]
3.
httpd.conf
WSGIScriptAlias / /Library/WebServer/Documents/blog/blog/wsgi.py
WSGIPythonPath /Library/WebServer/Documents
<Directory /Library/WebServer/Documents/blog>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
Alias /static/ /Library/WebServer/Documents/blog/static/
<Directory /Library/WebServer/Documents/blog/static>
Allow from all
</Directory>
DocumentRoot "/Library/WebServer/Documents"
<Directory "/Library/WebServer/Documents">
WSGIScriptAlias /blog /Library/WebServer/Documents/blog/blog/wsgi.py
http://blog.csdn.net/cocowuyung/article/details/51045703
http://blog.csdn.net/makingmaker/article/details/28600325