当前位置:网站首页>使用宝塔面板部署flask环境
使用宝塔面板部署flask环境
2022-06-26 13:43:00 【找BUG的老爷】
之前部署采用编译式,费时又费力,这次咱们采用简便的方法,就是采用宝塔面板进行安装。首先什么是宝塔面板呢,就是linux可视化管理工具,所以需要安装一下,这里说一下centos系统的安装
一、输入如下命令
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh接下来等几分钟,等出现下面的画面就是安装完成了

其中username和password就是宝塔的账号和密码了
二、将外网地址复制到浏览器打开,出现以下画面,并输入账号密码登录,如果是腾讯云的话需要放行8888端口


输入之后会出现下面的样子

选择同意进入面板

先注册面板账号


这样宝塔面板就安装完了,接下来就是搭建flask环境的过程了
首先在宝塔面板中找到python项目管理器,点安装,选择2.0的

点击设置

安装后进行项目的部署

需要项目里有requirements.txt文件,装三方库用,内容如下

然后点击确定进行部署
安装完成之后进行配置

[uwsgi]master = trueprocesses = 1threads = 2chdir = /www/wwwroot/translatewsgi-file= /www/wwwroot/translate/run.pycallable = appsocket = 127.0.0.1:5000logto = /www/wwwroot/translate/logs/error.logchmod-socket = 660vacuum = truemaster = trueuid=rootgid=rootmax-requests = 1000
此时输入ip端口就可以访问,接下来启动nginx,先安装



其中server_names是内网地址,root是项目路径

然后重启所有服务,至此就可以输入ip直接进行访问了
边栏推荐
- 在线牛人博主
- STM32F1和GD32F1有什么区别?
- Electron
- GDAL and opencv smooth and blur TIF images
- The annual salary of 500000 is one line, and the annual salary of 1million is another line
- Question bank and answers of the latest Guizhou construction eight (Mechanics) simulated examination in 2022
- [scoi2016] lucky numbers
- Usage of unique function
- Oracle ASMM and AMM
- SwiftUI找回丢失的列表视图(List)动画
猜你喜欢
随机推荐
SwiftUI找回丢失的列表视图(List)动画
Sword finger offer 09.30 Stack
Gartner 2022 Top Strategic Technology Trends Report
Pointer
idea快捷键
One article of the quantification framework backtrader read observer
[scoi2016] lucky numbers
The annual salary of 500000 is one line, and the annual salary of 1million is another line
Linear basis
《三体》摘录
Sword finger offer 15.65.56 I 56Ⅱ. Bit operation (simple - medium)
Niuke challenge 53:c. strange magic array
Recent important news
9 regulations and 6 prohibitions! The Ministry of education and the emergency management department jointly issued the nine provisions on fire safety management of off campus training institutions
ArcGIS secondary development -- arcpy batch automatic map publishing service
From Celsius to the three arrows: encrypting the domino of the ten billion giants, and drying up the epic liquidity
Matplotlib common operations
Electron
9項規定6個嚴禁!教育部、應急管理部聯合印發《校外培訓機構消防安全管理九項規定》
Flex & Bison 开始









