How to Set Up a HTML App with FastAPI, Jinja, Forms & Templates
I couldn’t find any guides on how to serve HTML with FastAPI. Thus, I wrote this simple article to plug the hole on the internet.
fastapi html templates jinja tutorial article code

I usually use Flask to build and deploy REST/web apps. Flask is simple to use and apps are easy to spin up with minimal code. Today, I decided to try FastAPI for my new web app, inspired by @tiangolo’s recent talk.

The switch was easier than expected. FastAPI has great documentation and this article by @amitness was useful. Nonetheless, I couldn’t find any guides on how to serve HTML with FastAPI. Thus, I wrote this simple article to plug the hole on the internet.

Don't forget to tag @eugeneyan in your comment, otherwise they may not be notified.

Authors community post
I work at the intersection of consumer data & tech to build machine learning systems to help customers, and write about how to be effective in data science, learning, and career.
Share this project
Similar projects
FastAPI
FastAPI framework, high performance, easy to learn, fast to code, ready for production.
FastAPI for Flask Users
A comprehensive guide to FastAPI with a side-by-side code comparison with Flask
Fast Api with Dockerization of your ML Models
In this GitHub repo you can able to know and learn how to build a fast API for testing your ML model and can test your ML model with UI and to Dockerize ...
Why We Switched from Flask to FastAPI for Production ML
The most popular tool isn’t always the best.
Top collections