mezzanine就是一个基于Django框架的应用, 详细可以参考官方网站:http://mezzanine.jupo.org/
2, Mezzanine 安装指南:
# Install from PyPI $ pip install mezzanine # Create a project $ mezzanine-project myproject $ cd myproject # Create a database $ python manage.py createdb # Run the web server $ python manage.py runserver
新建的项目如果要修改主题可以参考:https://github测试数据/renyi/mezzanine-themes.git
3,修改 nginx的配置文件
到你的 nginx 安装目录下的 conf目录下 修改配置文件 nginx.conf.
**** 关于部署由于之前静态文件的设置问题
cd /usr/local/nginx/conf/ gedit nginx.conf
添加如下内容:
注意 修改你对应项目的路径 比如 alias /home/daniel/myblog/static;
server {
listen 8080;
server_name 123456;
location / {
root /home/daniel/myblog/;
uwsgi_pass 127.0.0.1:8000;
include uwsgi_params;
}
location /static {
autoindex on;
alias /home/daniel/myblog/static;
access_log off;
log_not_found off;
}
location /robots.txt {
alias /home/daniel/myblog/static;
access_log off;
log_not_found off;
}
location /favicon.ico {
alias /home/daniel/myblog/static/img;
access_log off;
log_not_found off;
}
}
至于部署方式可以采用,uWSGI,http://projects.unbit.it/downloads/。
tar zxvf uwsgi-latest.tar.gz cd uwsgi-1.2.6 make cp uwsgi /usr/sbin/uwsgi
安装完uWSGI。
在你的工程目录下新建文件 django_wsgi.py
添加如下内容:
#!/usr/bin/env python
# coding: utf-8
import os,sys
if not os.path.dirname(__file__) in sys.path[:1]:
sys.path.insert(0, os.path.dirname(__file__))
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()
新建文件django.xml
添加如下内容,注意修改为自己的路径:
127.0.0.1:8000
true
/home/daniel/myblog
..
django_wsgi.py
true
文章转自: http://blog.csdn.net/daniel_ustc/article/details/8855303
查看更多关于DjangoMezzanineuwsginginx配置的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did86960