Flask에 대해 개인적으로 조금 더 알아보려고 했다.
from flask import Flask, render_template
import sys
application = Flask(__name__)
@application.route("/")
def hello():
return render_template('hello.html')
if __name__ == "__main__":
application.run(host='0.0.0.0')
render_template -> flask는 html을 불러오려면 render_template이 필요하고 html이 templates폴더에 있어야 한다.
if __name__ == "__main__":
파일을 직접 실행 했을 때는 ture값으로 실행은 되지만 다른 파일에 불러서 사용할 떄는 수행이 안되게 만드는 코드
postman post할때 body에 꼭 값을 입력하자