码迷,mamicode.com
首页 > 其他好文 > 详细

nginx+uwsgi部署fabric-bolt

时间:2015-01-09 12:45:14      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:shell

配置nginx.conf

vim nginx.conf    
     location / {
            root /www/fabric-bolt/lib/python2.7/site-packages/fabric_bolt;
            include   uwsgi_params;
            uwsgi_pass  192.168.1.121:9001;
            uwsgi_param UWSGI_CHDIR /www/fabric-bolt/lib/python2.7/site-packages/fabric_bolt;
            uwsgi_param UWSGI_SCRIPT wsgi;
            access_log /usr/local/nginx/logs/access.log;
        }
        location /static/ {
            alias /www/fabric-bolt/lib/python2.7/site-packages/fabric_bolt/work/myweb/static/;
            index index.html;
}


配置wsgi.xml:

vim uwsgi.xml

<uwsgi>
<socket>192.168.1.121:9001</socket>
<pidfile>/usr/local/nginx/conf/uwsgi.pid</pidfile>
<processes>2</processes>
<pythonpath>/www/fabric-bolt/lib/python2.7/site-packages</pythonpath>
<pythonpath>/www/fabric-bolt/lib/python2.7/site-packages/fabric_bolt</pythonpath>
<module>wsgi</module>
<chdir>/www/fabric-bolt/lib/python2.7/site-packages/fabric_bolt</chdir>
<daemonize>/tmp/uwsgi.log</daemonize>
</uwsgi>


这样nginx+uwsgi部署fabric-bolt的时候/tmp/uwsgi.log报错:

1.

  File "/www/fabric-bolt/lib/python2.7/site-packages/django/conf/__init__.py", line 151, in __init__
    raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

解决方法:fabric_bolt/wsgi.py

"core.settings"修改为""core.settings.settings"


2.

File "/www/fabric-bolt/lib/python2.7/site-packages/fabric_bolt/core/urls.py", line 4, in <module>
    import socketio.sdjango
django.core.exceptions.ImproperlyConfigured: Error importing module stronghold.middleware: "No module named socketio.sdjango


解决方法:

vim /www/fabric-bolt/lib/python2.7/site-packages/fabric_bolt/core/urls.py

注释掉socketio相关几行


3.

File "/www/fabric-bolt/lib/python2.7/site-packages/fabric_bolt/web_hooks/receivers.py", line 5, in <module>
    from fabric_bolt.projects.models import Deployment
django.core.exceptions.ImproperlyConfigured: Error importing module stronghold.middleware: "cannot import name Deployment"

解决方法:

vim core/settings/base.py

注释掉‘fabric_bolt.web_hooks‘,


这是可以访问通过nginx访问到fabric-bolt主页了:

技术分享





nginx+uwsgi部署fabric-bolt

标签:shell

原文地址:http://dragonball.blog.51cto.com/1459915/1600961

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