当前位置:网站首页>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
边栏推荐
- 198. 打家劫舍-动态规划
- 402. 移掉 K 位数字-贪心
- 给 el-dialog 增加拖拽功能
- Future usage details
- Type judgment in [untitled] JS
- QT modification UI does not take effect
- stm32入门开发板选野火还是正点原子呢?
- Qt error: /usr/bin/ld: cannot find -lGL: No such file or directory
- In ancient Egypt and Greece, what base system was used in mathematics
- 102. Sequence traversal of binary tree
猜你喜欢
双指针进阶--leetcode题目--盛最多水的容器
In embedded system, must the program code in flash be moved to ram to run?
JVM类加载机制
Using quartz under. Net core -- general properties and priority of triggers for [5] jobs and triggers
Double pointer advanced -- leetcode title -- container with the most water
Future usage details
STM32 entry development board choose wildfire or punctual atom?
Hcip fifth experiment
flink 学习(十二)Allowed Lateness和 Side Output
PC uses wireless network card to connect to mobile phone hotspot. Why can't you surf the Internet
随机推荐
Generating access keys using JSON webtoken
How to change input into text
31. Next arrangement
XTask与Kotlin Coroutine的使用对比
QT modification UI does not take effect
122. The best time to buy and sell stocks II - one-time traversal
2022年流动式起重机司机国家题库模拟考试平台操作
Oninput one function to control multiple oninputs (take the contents of this input box as parameters) [very practical, very practical]
vite配置proxy代理解决跨域
Index: teach you index from zero basis to proficient use
[ES6] promise related (event loop, macro / micro task, promise, await / await)
Type judgment in [untitled] JS
开期货,开户云安全还是相信期货公司的软件?
土地覆盖/利用数据产品下载
In embedded system, must the program code in flash be moved to ram to run?
Why do some people say SCM is simple and I have to learn it so hard?
Commonly used functions -- spineros:: and spineros::)
Ring back to origin problem - byte jumping high frequency problem
Node template engine (EJS, art template)
2021长城杯WP