html 다쓰면 괴롭다. 프레임 워크를 쓸때는 정해진 규칙을 따라야 함.
정해진 폴더 구조가 있다.
폴더 두개 만들기 -> New Directory
static : css나 이미지 파일들을 담아둘 때 씀
templates (->index.html 파일 만들기) : html 파일 담아두는 곳
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)
index.html 만 써도 자동으로 templates 안에 있는index.html 파일을 우리에게 갖다가 클라이언트한테 줌 .