flaskpython3nginx.docx
《flaskpython3nginx.docx》由会员分享,可在线阅读,更多相关《flaskpython3nginx.docx(1页珍藏版)》请在冰豆网上搜索。
Flask+nginx+python3+virtualenv
环境情况
1.系统为python2.7.x+django模式;
2.项目需要使用flask部署;故使用虚拟环境部署virtualenv
项目路径:
/opt/yundao/rich-exhibition/
虚拟路径:
/opt/venv
Virtualenv
1.创建项目的python3.6虚拟环境,不使用全局python模块
#virtualenv--no-site-packages-ppython3rich-exhibition
Runningvirtualenvwithinterpreter/usr/local/python3//bin/python3
Usingbaseprefix'/usr/local/python3'
Newpythonexecutablein/opt/venv/rich-exhibition/bin/python3
Alsocreatingexecutablein/opt/venv/rich-exhibition/bin/python
Installingsetuptools,pip,wheel...done.
2.激活虚拟环境并检查python版本以及pip3情况
#python-V
Python3.6.1
(rich-exhibition)[root@testvenv]#pip3list
PackageVersion
-----------------
pip9.0.1
setuptools36.0.1
wheel0.29.0
3.安装项目需要的模块
#pip3install-rrequirements.txt