static (1) 썸네일형 리스트형 [FastAPI] Template 🐰 FastAPI 공식문서를 보면서 개인적으로 정리한 글 입니다. html에 jinja2 Template을 사용할 수 있다. context를 사용하여 편하게 페이지를 꾸밀 수 있다. pip install jinja2 templates 폴더와 static 폴더를 만든다. templates 폴더에는 html 파일을 static 폴더에는 정적 파일을 넣는다. Item ID: {{ id }} StaticFiles를 사용하여 정적 파일(css, js, img, ...)을 관리할 수 있다. StaticFiles를 import하고 app에 특정경로에 StaticFiles() 인스턴스를 Mount한다. from fastapi import FastAPI from fastapi.staticfiles import Stati.. 이전 1 다음