当前位置:网站首页>Flask项目的部署详解
Flask项目的部署详解
2022-04-23 17:43:00 【宝藏女孩的成长日记】
哈喽,很高兴又见面啦,一起加油一起学习,欢迎您的关注!https://blog.csdn.net/hanhanwanghaha学习路上有您的关注是我的荣幸,一起进步是我的动力,明天也一起加油啊!
目录
宝塔更新Python版本
因为在宝塔中的Python版本为2.6.8,使用宝塔Python项目管理的话需要把Python升级到3.x,不然的话在部署的时候会提示有些模块下载失败。接下来开始操作:
apt安装
sudo apt install python3 python3-dev
安装依赖
安装完Python3之后,默认会安装Python包管理器pip。安装Python3以后会变为pip3命令来下载依赖。
pip3 install gevent-websocket
pip3 install psutil
easy_install Flask_Session
更改默认的Python版本
删除默认版本
sudo rm /usr/bin/python
将python3版本设置为系统默认版本
sudo ln -s /usr/bin/python3 /usr/bin/python
更改pip版本
sudo rm /usr/bin/python
sudo ln -s /usr/bin/pip3 /usr/bin/pip
重启宝塔面板即可。
项目部署
Flask项目打包
导出项目依赖包
pip freeze >requirements.txt
项目管理器部署项目
设置映射
完成
访问刚刚映射的地址即可。
版权声明
本文为[宝藏女孩的成长日记]所创,转载请带上原文链接,感谢
https://blog.csdn.net/hanhanwanghaha/article/details/124068338
边栏推荐
- Open futures, open an account, cloud security or trust the software of futures companies?
- 239. 滑动窗口最大值(困难)-单向队列、大顶堆-字节跳动高频题
- Change Oracle to MySQL
- 470. Rand10() is implemented with rand7()
- Using quartz under. Net core -- preliminary understanding of [2] operations and triggers
- tidb-server 的配置文件在哪里?
- 油猴网站地址
- SQL optimization for advanced learning of MySQL [insert, primary key, sort, group, page, count]
- Using quartz under. Net core -- general properties and priority of triggers for [5] jobs and triggers
- 402. 移掉 K 位数字-贪心
猜你喜欢
JS parsing and execution process
常用SQL语句总结
flink 学习(十二)Allowed Lateness和 Side Output
Kubernetes 服务发现 监控Endpoints
Gets the time range of the current week
Use of todesk remote control software
Chrome浏览器的跨域设置----包含新老版本两种设置
.Net Core3. 1 use razorengine NETCORE production entity generator (MVC web version)
Dry goods | how to extract thumbnails quickly?
Compare the performance of query based on the number of paging data that meet the query conditions
随机推荐
402. Remove K digits - greedy
31. 下一个排列
超分之TDAN
Where is the configuration file of tidb server?
958. Complete binary tree test
Collection of common SQL statements
Using quartz under. Net core -- operation transfer parameters of [3] operation and trigger
122. 买卖股票的最佳时机 II-一次遍历
440. The k-th small number of dictionary order (difficult) - dictionary tree - number node - byte skipping high-frequency question
Webapi + form form upload file
Header built-in object
Construction of functions in C language programming
Summary of common SQL statements
古代埃及希腊,数学用的什么进制
Arithmetic expression
1217_ Generating target files using scons
索引:手把手教你索引从零基础到精通使用
Sword finger offer 03 Duplicate number in array
C语言程序设计之函数的构造
PC uses wireless network card to connect to mobile phone hotspot. Why can't you surf the Internet