Programing Language/Python

Python) Flask 서버 작업후 업데이트 하는방법

Jude_Song 2020. 12. 13. 22:34
728x90
반응형

Gunicorn + nginx + falsk로 서버 작업을 하다 가상환경에서 실행중인 py파일을 업데이트 하려면

systemctl restart myproject  을 적용하면 

 

from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
return "<h1 style='color:blue'>Hello There!</h1>"
//추가 코드
@app.route("/test")
def hi():
return "<h1 style='color:blue'>test</h1>"
if __name__ == "__main__":
app.run(host='0.0.0.0')

 

추가 코드가 적용된다.

728x90
반응형