首页 > 代码库 > nginx+uwsgi部署fabric-bolt
nginx+uwsgi部署fabric-bolt
配置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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。