安装环境:
- Mac(10.9) + nginx(1.4.7) + python(2.7.5) + uwsgi(2.0.4) + django-cms(2.4.3)
- 使用supervisord做后台守护进程
- 默认系统已经安装python, nginx
使用virtualenv 作为python部署环境
- 安装virtualenv easy_install virtualenv
- 安装pip easy_install pip
- 创建python虚拟环境 virtualenv .env
- 使用虚拟环境 source .env/bin/activate
- 安装django-cms pip install django-cms==2.4.3(安装程序好自动安装依赖的对应版本的插件,django,south。。。)
- 安装uwsgi pip install uWSGI
- 安装supervisord pip install supervisor
- 创建django-cms项目 django-admin.py startproject demo
- 使用默认的方式运行项目 cd demo && python manage.py runserver
- 访问http://localhost:8000查看页面是否正常
- 使用uwsgi 启动项目 uwsgi --socket 127.0.0.1:9001 --protocol http --chdir 项目的目录 --venv .env --wsgi-file demo/demo/wsgi.py
- 配置supervisor来后台守护uwsgi进程 ,尽量使用默认配置
[program:demo] command= .env/bin/uwsgi --protocal=http --socket=127.0.0.1:9001 --chdir=Projects/Python/demo --wsgi-file=rojects/Python/demo/demo/wsgi.py --venv=Projects/Python/.env --processes=2 autostart=true ; start at supervisord start (default: true) stopsignal=INT ; signal used to kill process (default TERM) stdout_logfile_maxbytes=10MB ; max # logfile bytes b4 rotation (default 50MB) stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) stderr_logfile_maxbytes=10MB ; max # logfile bytes b4 rotation (default 50MB) stderr_logfile_backups=10 ; # of stderr logfile backups (default 10)
13. 运行supervisord sudo supervisord -c /etc/supervisord.conf
14. 使用nginx 做前端转发
location / { include uwsgi_params; proxy_pass http://127.0.0.1:9001; }
15. 访问页面看效果
遇到的问题:
- no loaded app :解决方法 不要使用 -s , 需要使用--socket 和protocol, 并且指定wsgi-file
- supervisorctl 无法启动 显示unload confignation from ..., 项目的路径应该是绝对路径,不能是软连接
- 如果nginx无法使用uwsgi_pass, 可以使用proxy_pass 做反向代理
参考:https://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
相关推荐
core of the Web, using common Python idioms. On top of that CherryPy offers its own view and concepts on how to help a developer to build web applications while being minimally intrusive through its...
$ sudo pip3 install webdeploy 使用来源 $ git clone https://github.com/idaljeetsingh/webdeploy $ cd webdeploy $ sudo python3 setup.py install 笔记 :memo: 最好重新安装Ubuntu。 必须使用sudo安装软件包...
Untangle your web scraping complexities and access web data with ease using Python scripts Key FeaturesHands-on recipes to advance your web scraping skills to expert levelAddress complex and ...
不得擅自修改该文件,如果你在使用中有什么意见,可以和作者联系,联系方式:whj7510@citiz.net 解决.NET(WebApplication)安装部署的不能选择安装路径的问题
WebDeploy_amd64_zh-CN.msi 发布工具 WebDeploy_amd64_zh-CN.msi
coding will require basic skills in the Python programming language. The book is also for those who wish to learn about a larger ecosystem of tools for retrieving, storing, and searching data, as well...
资源分类:Python库 所属语言:Python 资源全名:deploy-1.5.0.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
当时自己安装vs2012时 webdeploy3.0安装失败了 自己在搞了半天才找到这个 希望对大家有用吧
资源分类:Python库 所属语言:Python 资源全名:deploy_it-0.3.3.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
Design, develop, and deploy a real-world web application by leveraging modern open source technologies. This book shows you how to use ASP.NET Core to build cross-platform web applications along with ...
WebDeploy 同步IIS6的资料,采用visual studio 发布应用程序
Build an interactive and full-featured web application from scratch using Node.js and MongoDB About This Book Configure your development environment to use Node.js and MongoDB Use Node.js to connect ...
利用M$的Web Deploy工具迁移IIS6站点到IIS7
官方离线安装包,亲测可用
With this book as their guide, readers will be able to configure and deploy Ubuntu Servers using Ubuntu Server 16.04, with all the skills necessary to manage real servers. The book begins with the ...
WebDeploy发布需要的数据库支持工具
Successfully build and deploy a movie recommendation system application using the Django framework in Python About Python is a general purpose and also a comparatively easy to learn programming ...
WebDeploy不仅仅让你发布文件—还可以部署数据库结构/数据,运行变更的数据库脚本,设置安全访问控制列表等等。所有这些部署步骤都可以用VisualStudio自动完成。 Web部署工具可简化IISweb服务器、Web应用程序和网站...
ASP.NET Core: Cloud-ready, Enterprise Web Application Development by Mugilan T. S. Ragupathi English | 9 Jun. 2017 | ASIN: B072KDVHCS | 1414 Pages | AZW3 | 36.34 MB Create fast, scalable, and high-...
deploy.application