第二天 django apache

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了第二天 django apache相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

Django TodayArchiveView 显示第二天的日期

django之第二天

django第二天

Django 第二天 创建Django项目

Django 学习第二天

django 学习第二天