码迷,mamicode.com
首页 > Web开发 > 详细

第二天 django apache

时间:2016-10-02 17:07:11      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:

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

第二天 django apache

标签:

原文地址:http://www.cnblogs.com/javastart/p/5927541.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!