当前位置:网站首页>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
边栏推荐
- C dapper basically uses addition, deletion, modification and query transactions, etc
- Excel quickly and automatically fills the contents of a row on a blank cell
- Using quartz under. Net core -- preliminary understanding of [2] operations and triggers
- Kubernetes 服务发现 监控Endpoints
- How to change input into text
- JS failed to change all variables and changed to the return method. Finally, the problem was solved
- Double pointer advanced -- leetcode title -- container with the most water
- Some questions some questions some questions some questions
- Read software engineering at Google (15)
- Index: teach you index from zero basis to proficient use
猜你喜欢
MySQL进阶之索引【分类,性能分析,使用,设计原则】
102. Sequence traversal of binary tree
Dry goods | how to extract thumbnails quickly?
Double pointer advanced -- leetcode title -- container with the most water
Leak detection and vacancy filling (6)
干货 | 快速抽取缩略图是怎么练成的?
958. Complete binary tree test
MySQL installation
HCIP第五次实验
Gets the time range of the current week
随机推荐
EasymodbusTCP之clientexample解析
ros常用的函数——ros::ok(),ros::Rate,ros::spin()和ros::spinOnce()
Kubernetes service discovery monitoring endpoints
Use of todesk remote control software
一些问题一些问题一些问题一些问题
JS failed to change all variables and changed to the return method. Finally, the problem was solved
Tdan over half
Learning record of uni app dark horse yougou project (Part 2)
102. Sequence traversal of binary tree
209. Minimum length subarray - sliding window
Router object, route object, declarative navigation, programmed navigation
.Net Core3. 1 use razorengine NETCORE production entity generator (MVC web version)
Self use learning notes - connectingstring configuration
Double pointer advanced -- leetcode title -- container with the most water
2022年茶艺师(初级)考试模拟100题及模拟考试
In ancient Egypt and Greece, what base system was used in mathematics
Ring back to origin problem - byte jumping high frequency problem
122. The best time to buy and sell stocks II - one-time traversal
flink 学习(十二)Allowed Lateness和 Side Output
198. 打家劫舍-动态规划