FastAPI Python framework - Returning HTML templates (with HTMX integration)

preview_player
Показать описание
In this video, we look at how to return HTML templates with the FastAPI web framework in Python. We will use Jinja2 templates, and will set our FastAPI function up to return a template response.

We'll also look at how to integrate with the HTMX library, allowing us to easily utilise dynamic data loading in our FastAPI application.

We will also apply some very basic styles to our page using TailwindCSS.

▶️ Full Playlist:

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
00:31 Setup
02:56 Creating FastAPI route
05:28 Adding HTMX and TailwindCSS
06:26 Displaying data in HTML table
07:52 Returning data from FastAPI route
09:26 Adding HTMX attributes to button
12:17 FastAPI headers
14:33 Adding hx-swap attribute

☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:

𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:

📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:

#fastapi #python
Рекомендации по теме
Комментарии
Автор

So nice watching a video like this. You go at the perfect pace, cover all the bases and no BS. Thank you!

WastedHalo
Автор

The only reason why I feed my YouTube algorithm with creators having a small number of subscribers is to not miss out on such an incredibly good YouTube channel like this one. Thank you, you have helped me a lot with the {%for file in files%} {%endfor%} :-*

aleksalukic
Автор

Fantastic tutorial. Every step so clear and well described. I don't know why everyone doesn't do tutorials like this.

falcomomo
Автор

This is great! I appreciate how you iterate to the final solution and recap the material at the end. I think that makes the video really effective. Good stuff.

MichaelBuksas
Автор

Phenomenal. I had been wondering about switching from Flask to FastAPI for some small web projects and this has convinced me to go for it. When I saw you were pulling in Tailwind I just knew you could be trusted. Excellent stuff this.

_indrid_cold_
Автор

I've been looking all over for this topic, thank you!

Trumancapote
Автор

Great, Don't have enough praise for your python contents.

davishek
Автор

love your style, fast pace, dense and information rich, help me to focus and pay attention. keep up the great work.😊

mj
Автор

Wow! First time seeing one of your videos. STELLAR explanation. Subscribed. Thank you.

seadude
Автор

Thanks - first video of yours I've seen, and it solved my beginner problem with Jinja2 templates. Cheers, from a fellow Scot

loosetorque
Автор

your videos about FastApi that what I need! Doing a project now, I am newby in FastAPI, my project will be a Poll for teachers

deymonsteru
Автор

Just what I was looking for, thanks !!!

xjuliodiaz
Автор

You're awesome mate. Really liking your videos. Keep it up!

shinchikichin
Автор

Great content man. As always.
Looking forward to your content on using Fastapi as a full-fledged backend including django like user authentication.

theindianhindu
Автор

Hea @BugBytes, I really love your teaching.
Can we get a full course on returning HTML templates, alongside working with forms with FastAPi please?

royale
Автор

“We don’t want a table embedded in a button as arguably not a best user experience “ Love that part 😂

devilslide
Автор

thanks for the good video For non-English speaking Asians, your correct pronunciation is much easier to understand than an American's more difficult pronunciation. - From Korea

stevekim
Автор

Awesome tutorial. Can you please do one video with JWT token authentication.

razalovepk
Автор

Nice video. Is there a second part with the DB setup? Thanks.

StrategicCIS
Автор

Thanks bro! What about xxs attacks in this case ?
In Django we have security from the box, what about fastapi?

archibaldivanovich