Python FastAPI Tutorial (Part 2): HTML Frontend for Your API - Jinja2 Templates @coreyms
Python FastAPI Tutorial (Part 2): HTML Frontend for Your API - Jinja2 Templates  @coreyms
Uploaded January 2026 | Updated November 2026, 3 hours ago
In this Python FastAPI tutorial, we'll be learning how to use Jinja2 templates to create an HTML frontend for our API. Templates allow us to serve proper HTML pages to users while keeping our JSON endpoints intact for the backend API. We'll cover setting up Jinja2Templates, passing data to templates, using Jinja2 syntax for loops and conditionals, implementing template inheritance with a layout file, adding Bootstrap for styling, and configuring static files for CSS and images. By the end of this video, we'll have a nicely styled blog homepage that displays our posts. Let's get started...

The code from this video can be found here:
github.com/CoreyMSchafer/FastAPI-02-Templates

Full FastAPI Course:
youtube.com/playlist?list=PL-osiE80TeTsak-c-QsVeg0YYG_0TeyXI

✅ Support My Channel Through Patreon:
patreon.com/coreyms

✅ Become a Channel Member:
youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g/join

✅ One-Time Contribution Through PayPal:
goo.gl/649HFY

✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey's Public Amazon Wishlist
http://a.co/inIyro1

✅ Equipment I Use and Books I Recommend:
amazon.com/shop/coreyschafer

▶️ You Can Find Me On:
My Website - coreyms.com
My Second Channel - youtube.com/c/coreymschafer
Facebook - facebook.com/CoreyMSchafer
Twitter - twitter.com/CoreyMSchafer
Instagram - instagram.com/coreymschafer

#Python #FastAPI
Python FastAPI Tutorial (Part 2): HTML Frontend for Your API - Jinja2 TemplatesPython Flask Tutorial: How to enable HTTPS with a free SSL/TLS Certificate using Lets EncryptPython FastAPI Tutorial (Part 10): Authentication - Registration and Login with JWTPython Pandas Tutorial (Part 6): Add/Remove Rows and Columns From DataFramesJupyter Notebook Tutorial: Introduction, Setup, and WalkthroughPython Tutorial: Simulate the Powerball Lottery Using PythonPython Threading Tutorial: Run Code Concurrently Using the Threading ModulePython Quick Tip: Hiding Passwords and Secret Keys in Environment Variables (Windows)Speed Up Your Code by Learning AsyncIOHow to Send Emails Using Python - Plain Text, Adding Attachments, HTML Emails, and MorePython Tutorial: re Module - How to Write and Match Regular Expressions (Regex)Linux/Mac Terminal Tutorial: How To Use The find Command
Corey Schafer |

Python FastAPI Tutorial (Part 2): HTML Frontend for Your API - Jinja2 Templates

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER