The running command of the python project:
ps -aux | grep __init__.py #查看项目运行端口
kill -9 进程id #杀死进程
nohup python3 __init__.py > output2.log 2>&1 & #启动项目(后台启动)
python3 __init__.py #前台启动
jobs #查看运行的所有项目
Note: When flask runs and deploys on the server, ensure that all ips can access the project
The running port needs to be set to 0.0.0.0: instead of localhost!
if __name__ == "__main__":
app.run('0.0.0.0','8099')
Configure cross-domain:
from flask_cors import CORS
cors = CORS(app, resources={
r"/*"})