📁디렉토리 생성
templates - html파일
static - 이미지, css파일 등
render_template
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
if __name__ == '__main__':
app.run('0.0.0.0',port=5000,debug=True)
"배포"
서버에서 작동하기때문에 타인도 볼 수 있는 웹페이지
↔내 컴퓨터의 파일을 여는 것!
@app.route('/mypage')
def mypage():
return 'This is Mypage!'