当前位置:网站首页>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
边栏推荐
- Qt error: /usr/bin/ld: cannot find -lGL: No such file or directory
- 122. 买卖股票的最佳时机 II-一次遍历
- 古代埃及希腊,数学用的什么进制
- This point in JS
- Come out after a thousand calls
- 索引:手把手教你索引从零基础到精通使用
- 2022年上海市安全员C证操作证考试题库及模拟考试
- 122. The best time to buy and sell stocks II - one-time traversal
- 1217_ Generating target files using scons
- .Net Core3. 1 use razorengine NETCORE production entity generator (MVC web version)
猜你喜欢

SiteServer CMS5. 0 Usage Summary

102. 二叉树的层序遍历

Why do some people say SCM is simple and I have to learn it so hard?

470. 用 Rand7() 实现 Rand10()

PC uses wireless network card to connect to mobile phone hotspot. Why can't you surf the Internet

编译原理 求first集 follow集 select集预测分析表 判断符号串是否符合文法定义(有源码!!!)

QT modification UI does not take effect

HCIP第五次实验

470. Rand10() is implemented with rand7()

2022年上海市安全员C证操作证考试题库及模拟考试
随机推荐
Using quartz under. Net core -- general properties and priority of triggers for [5] jobs and triggers
Allowed latency and side output
01-初识sketch-sketch优势
Write a regular
【Appium】通过设计关键字驱动文件来编写脚本
JVM类加载机制
EasymodbusTCP之clientexample解析
node中,如何手动实现触发垃圾回收机制
Using quartz under. Net core - calendar of [6] jobs and triggers
PC uses wireless network card to connect to mobile phone hotspot. Why can't you surf the Internet
Qt error: /usr/bin/ld: cannot find -lGL: No such file or directory
2022年上海市安全员C证操作证考试题库及模拟考试
The system cannot be started after AHCI is enabled
vite配置proxy代理解决跨域
1217_使用SCons生成目标文件
Ouvrir des contrats à terme, ouvrir des comptes en nuage ou faire confiance aux logiciels des sociétés à terme?
土地覆盖/利用数据产品下载
MySQL installation
Sword finger offer 22 The penultimate node in the linked list - speed pointer
MySQL advanced index [classification, performance analysis, use, design principles]