当前位置:网站首页>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

边栏推荐
- 【点云处理之论文狂读经典版8】—— O-CNN: Octree-based Convolutional Neural Networks for 3D Shape Analysis
- Crawler career from scratch (II): crawl the photos of my little sister ② (the website has been disabled)
- Flink学习笔记(九)状态编程
- LeetCode 438. Find all letter ectopic words in the string
- Go language - Reflection
- 图像修复方法研究综述----论文笔记
- 2022-2-14 learning xiangniuke project - Session Management
- C language programming specification
- State compression DP acwing 291 Mondrian's dream
- [set theory] order relation (chain | anti chain | chain and anti chain example | chain and anti chain theorem | chain and anti chain inference | good order relation)
猜你喜欢

State compression DP acwing 291 Mondrian's dream

图像修复方法研究综述----论文笔记

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

Flink学习笔记(十一)Table API 和 SQL

Crawler career from scratch (IV): climb the bullet curtain of station B through API

【点云处理之论文狂读前沿版9】—Advanced Feature Learning on Point Clouds using Multi-resolution Features and Learni

Excel is not as good as jnpf form for 3 minutes in an hour. Leaders must praise it when making reports like this!

LeetCode 241. Design priorities for operational expressions

Basic knowledge of network security

2022-2-14 learning xiangniuke project - generate verification code
随机推荐
【点云处理之论文狂读经典版8】—— O-CNN: Octree-based Convolutional Neural Networks for 3D Shape Analysis
[point cloud processing paper crazy reading frontier version 10] - mvtn: multi view transformation network for 3D shape recognition
[graduation season | advanced technology Er] another graduation season, I change my career as soon as I graduate, from animal science to programmer. Programmers have something to say in 10 years
Beego learning - JWT realizes user login and registration
2022-2-14 learning xiangniuke project - generate verification code
Crawler career from scratch (V): detailed explanation of re regular expression
There is no open in default browser option in the right click of the vscade editor
[set theory] order relation (chain | anti chain | chain and anti chain example | chain and anti chain theorem | chain and anti chain inference | good order relation)
Hudi 集成 Spark 数据分析示例(含代码流程与测试结果)
Win10 quick screenshot
2022-2-13 learn the imitation Niuke project - Project debugging skills
【Kotlin学习】高阶函数的控制流——lambda的返回语句和匿名函数
dried food! What problems will the intelligent management of retail industry encounter? It is enough to understand this article
【点云处理之论文狂读经典版11】—— Mining Point Cloud Local Structures by Kernel Correlation and Graph Pooling
LeetCode 57. Insert interval
With low code prospect, jnpf is flexible and easy to use, and uses intelligence to define a new office mode
Go language - IO project
[point cloud processing paper crazy reading frontier edition 13] - gapnet: graph attention based point neural network for exploring local feature
Using Hudi in idea
[point cloud processing paper crazy reading classic version 11] - mining point cloud local structures by kernel correlation and graph pooling