当前位置:网站首页>Run flash demo on ECS
Run flash demo on ECS
2022-07-03 09:24:00 【zeng31403】
Running on ECs Flask DEMO
I did a good job on ECs two days ago python Installation , Today, try how to run on the server Flask
my linux The foundation is not very good , Feel the stone to cross the river
- install flask
pip install flask
fast , It used to be on Alibaba cloud pip The source of is directly changed to Alibaba cloud's image server .
- import Have a try no way , Checked, maybe pip The installed path is not added to the system
PATH environment variable . Look at the online statement change PATH It seems a little difficult , It is also possible to create a virtual environment
try 
cd To create a good project directory projects/flask_car
cd projects/flask_carEnter to create virtual environment
virtualenv flask
After creating ls once , More than a flask Catalog , Again cd go in

Activate flask A virtual environment source bin/activate
Here to install pip install flask

Back up one level after installation ,ls following , Run written server.py Demo


Press CTRL After clicking , Errors occurred . Connection rejected , It's not that simple . The firewall needs to be turned on

deactivate Exit virtual environment
firewall-cmd --state View firewall status , Not open

systemctl start firewalld Start the firewall
firewall-cmd --zone=public --add-port=5000/tcp --permanent
I don't know whether this one works , I went to the security group of the system to add 5000 Port access permission rules

Until then flask Re run in the environment server.py, test

- server.py Code
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return '<center><h1>Hello Flask,This is the first page</h1></center>'
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True, port=5000)
- Click the link 0.0.0.0:5000, cannot access . The external network should be a public network IP Of .
- Change to public network IP:5000, finally Demo Page appears .Flask Debugging completed . The local firewall does not affect

边栏推荐
- LeetCode 438. Find all letter ectopic words in the string
- Basic knowledge of database design
- [set theory] order relation (eight special elements in partial order relation | ① maximum element | ② minimum element | ③ maximum element | ④ minimum element | ⑤ upper bound | ⑥ lower bound | ⑦ minimu
- Go language - Reflection
- ERROR: certificate common name “www.mysql.com” doesn’t match requested host name “137.254.60.11”.
- [kotlin learning] classes, objects and interfaces - define class inheritance structure
- Utilisation de hudi dans idea
- Principles of computer composition - cache, connection mapping, learning experience
- [point cloud processing paper crazy reading classic version 13] - adaptive graph revolutionary neural networks
- The server denied password root remote connection access
猜你喜欢

【点云处理之论文狂读前沿版13】—— GAPNet: Graph Attention based Point Neural Network for Exploiting Local Feature

Flink学习笔记(九)状态编程

【点云处理之论文狂读前沿版8】—— Pointview-GCN: 3D Shape Classification With Multi-View Point Clouds

IDEA 中使用 Hudi

LeetCode 30. Concatenate substrings of all words

Introduction to the basic application and skills of QT
![[advanced feature learning on point clouds using multi resolution features and learning]](/img/f0/abed28e94eb4a95c716ab8cecffe04.png)
[advanced feature learning on point clouds using multi resolution features and learning]

Vscode编辑器右键没有Open In Default Browser选项

【Kotlin学习】高阶函数的控制流——lambda的返回语句和匿名函数

2022-2-14 learning xiangniuke project - Session Management
随机推荐
LeetCode 508. The most frequent subtree elements and
How to check whether the disk is in guid format (GPT) or MBR format? Judge whether UEFI mode starts or legacy mode starts?
[kotlin learning] classes, objects and interfaces - classes with non default construction methods or attributes, data classes and class delegates, object keywords
Utilisation de hudi dans idea
Move anaconda, pycharm and jupyter notebook to mobile hard disk
2022-2-14 learning the imitation Niuke project - send email
Serializer rewrite: update and create methods
LeetCode 535. Encryption and decryption of tinyurl
Flink学习笔记(十)Flink容错机制
Powerdesign reverse wizard such as SQL and generates name and comment
LeetCode 75. Color classification
LeetCode 715. Range module
npm install安装依赖包报错解决方法
Navicat, MySQL export Er graph, er graph
Crawler career from scratch (II): crawl the photos of my little sister ② (the website has been disabled)
Basic knowledge of network security
Crawler career from scratch (I): crawl the photos of my little sister ① (the website has been disabled)
Notes on numerical analysis (II): numerical solution of linear equations
[point cloud processing paper crazy reading cutting-edge version 12] - adaptive graph revolution for point cloud analysis
MySQL installation and configuration (command line version)