当前位置:网站首页>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 flaskAfter 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 --permanentI 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
边栏推荐
- How to check whether the disk is in guid format (GPT) or MBR format? Judge whether UEFI mode starts or legacy mode starts?
- There is no open in default browser option in the right click of the vscade editor
- Go language - IO project
- Matlab dichotomy to find the optimal solution
- Redis learning (I)
- Install third-party libraries such as Jieba under Anaconda pytorch
- Simple use of MATLAB
- [point cloud processing paper crazy reading frontier version 10] - mvtn: multi view transformation network for 3D shape recognition
- Jenkins learning (III) -- setting scheduled tasks
- LeetCode 438. Find all letter ectopic words in the string
猜你喜欢
[kotlin learning] classes, objects and interfaces - classes with non default construction methods or attributes, data classes and class delegates, object keywords
[kotlin learning] classes, objects and interfaces - define class inheritance structure
Introduction to the basic application and skills of QT
Sword finger offer II 029 Sorted circular linked list
CSDN markdown editor help document
Hudi learning notes (III) analysis of core concepts
【点云处理之论文狂读经典版7】—— Dynamic Edge-Conditioned Filters in Convolutional Neural Networks on Graphs
Crawler career from scratch (II): crawl the photos of my little sister ② (the website has been disabled)
Crawler career from scratch (I): crawl the photos of my little sister ① (the website has been disabled)
[point cloud processing paper crazy reading classic version 10] - pointcnn: revolution on x-transformed points
随机推荐
Go language - Reflection
2022-2-13 learning xiangniuke project - version control
2022-2-14 learning xiangniuke project - generate verification code
NPM install installation dependency package error reporting solution
[kotlin learning] classes, objects and interfaces - define class inheritance structure
Database execution error: SQL_ mode only_ full_ group_ by:
Modify idea code
【Kotlin学习】高阶函数的控制流——lambda的返回语句和匿名函数
Excel is not as good as jnpf form for 3 minutes in an hour. Leaders must praise it when making reports like this!
Django operates Excel files through openpyxl to import data into the database in batches.
Banner - Summary of closed group meeting
Numerical analysis notes (I): equation root
2022-2-14 learning the imitation Niuke project - send email
Crawler career from scratch (3): crawl the photos of my little sister ③ (the website has been disabled)
The "booster" of traditional office mode, Building OA office system, was so simple!
【点云处理之论文狂读前沿版12】—— Adaptive Graph Convolution for Point Cloud Analysis
WARNING: You are using pip ; however. Later, upgrade PIP failed, modulenotfounderror: no module named 'pip‘
In the digital transformation, what problems will occur in enterprise equipment management? Jnpf may be the "optimal solution"
Problems in the implementation of lenet
[point cloud processing paper crazy reading classic version 10] - pointcnn: revolution on x-transformed points