@@JonathanCrossland exactly, I dont see the point of creating html structures in a python route when you should easily return a simple html template or partial. not only its more easy to understand it for a whole dev community out there but also makes everything more modular in terms of stack migration and compatibility with other frameworks. now this is a big fruit salad. what hypermedia frameworks really need is a ui library focused on premade html templates that can be easily copy pasted and have a collection of versatile routes functions dedicated to the big backend stacks out there like nodejs python php and java. I really would do it if I didnt have so many projects in my hands already.
Wow! This is huge. As a data scientist I realized that I need to learn some web dev to become more versatile; however it is a lot to learn and a lot of time invested plus having a full time job and family. It seems to be a great shortcut, I am going to try it out.
Backend here in multiple languages at first I was against learning frontend development and js/ts. Start small bud just learn basic HTML, css and js. Freecodecamp curriculum or traversy 30 projects course is perfect. You don’t need to learn npm, react and fancy stuff. If you ever need more then learn a frontend framework. Trying to stay in python for everything is swimming against the current and limits what you can do.
I like how we engineers, like to reinvent things, every 5 years we go through cycles of simplifying things, then as complexity of requirements grow we get back to the status quo :) Feels like reimplementation of GWT and co, with similar benefits and downsides.
No not at all similar to GWT. Totally different approach. This is closer to elixir phoenix liveview, or ruby hotwire. But not really the same as them either -- much simpler and closer to the bare bones of the web.
Wow ... streamlit has been my most favorite but this is looking really great... I love the simplicity of streamlit if you guys can magic the simplicity of streamlit into fasthtml with your genius thinking it would be a revolution i think... Thank you very much...
Reading through the comments here, you have obviously produced something amazing and wonderful. If I understand it correctly, your program can make web-pages in HTML. And you built it in Python. Well done! I am assuming from the comments that building a web page this way is faster than writing one in HTML. So well done! Keep up the good work.
simple & beautiful, already feels less clunky than some other python wrapper-based frameworks. Excited to try it out, been a fan of your courses and work. Thank you Jeremy!
This is fantastic! My dream is for web development to evolve into a process where humans can design in a style similar to using Figma and propose functionalities in plain language, with AI connecting the front-end and back-end work somehow. In this ideal world, the coding required for non-computer scientists or IT professionals (like me, a creative and curious human being) would be minimal, perhaps limited to just HTML or CSS for styling. I’d love to bring my ideas to life without the steep learning curve of coding. That would be amazing someday… (Let me dream). I’m really excited that your work seems to be moving in this direction. Thanks for sharing!
Still a bit abstract for me. I could better relate if you converted a streamlit app to FastHTML. I'd feel more grounded if I could compare the two source codes.
Introduction to Fast HTML - 00:00:01 Demo of Fast HTML Capabilities - 00:00:10 Benefits and Use Cases of Fast HTML - 00:01:08 Comparisons with Other Web Frameworks - 00:01:37 Creating a To-Do Web Application - 00:03:14 Defining Routes and Components - 00:03:46 Using Templates and Python Functions - 00:04:12 Adding Interactivity with HTMX - 00:04:40 Adding Persistency with SQLite - 00:05:15 Enhancing UI and Functionality - 00:05:51 Expanding Features and Components - 00:06:22 Authentication and Deployment - 00:06:53 Documentation and Examples - 00:07:24
I am looking forward to where FastHTML goes... I love Django and HTMX, but for most use cases I can see FastHTML and SQLite being more than enough - especially with the ease of HTMX interaction...
I think a comparison to streamlit will be a nice idea to promote this framework. Streamlit is extremly laggy for my usecase as I have to constantly to update my ui so I will def give a try to your framework. Thank you for awesome job!
Python based web development would be awesome, but as a python first coder that has used Flask/Django. I've found that my biggest pain point is that the frameworks are very difficult to deploy as they require continuous server operation at scale, whereas javascript can be deployed as a static file in a CDN run on the client and then scales really well with stateless apis built into cloud functions in any language you like that aren't constantly running and can be scaled up on demand. I started with Django and Flask and have deployed on python anywhere, but I found it very challenging to get the architecture to work once I built the app even though it was way faster to build the app. I didn't find that the code or the framework was my issue. I would really like to see a very quick and easy way to deploy python apps that used WASM (I know nothing about WASM) or had a framework that could be deployed to cloud functions not servers in a stateless way with javascript scaffolding? I believe deployment is why people don't build many web apps with python. If you look at streamlit/mesop they are fine, but deployment is not easy.
Huh, this is quite a refresher to hear! Or at least I think so… HTML/CSS/JS is the bare I hear to start web 'dev-ing', and just like the meme, that is what I first thought cuz technologies like frameworks got me a little worried of how much I actually need to learn… From what I understand, frameworks are almost like Linux distros. Now, the reasons I want to learn python is largely of the influence by the Blender foundation. This 'FastHTML' as I understand it, unifies already established web components… And with python in the mix… Well, this might be my cup of tea after all :) - Although I'm getting ahead of myself as I'm still far from my journey to be coming a web dev, lmao. 😅Just sharing my enthusiasm. I guess lastly… Why the name 'FastHTML'? When it's obviously more than just HTML. Is it to emphasise it's almost as fast as HTML?
Real cool, I’m no web dev, but sometimes I need to create some basic ui for my projects, big fan of HTMX, I’ve used it with Flask, is there a learning curve in using your library in my use case?
This is cool - the main problem I have found with most of these Python -> HTML frameworks is that I almost always want two way bindings between a chart (Plotly for example) and the app. Does FastHTML support this in some way? I just want to interact with my selected data points without having to write a react app or use Dash lol
Yes it does, but not through a reactive design, but through responding to standard JS events. FastHTML doesn't add new abstractions on top of web standards, but instead makes those standards more easily available.
A framework can't fully handle security for you, but we certainly thought carefully about it for FastHTML. `examples/adv_app.py` in the FastHTML repo shows an example of custom authentication along with notes on how it works. It should be production-ready, although obviously since it's very new, it's less well-tested in practice. Most of our sites run on it now.
Writing hmtx and html-ish code right in your controller looks horrible to maintain. I already had some issues with django's forms for that but this goes way deeper into the concept. I would love to hear your thoughts on this The speed at which you can get things running looks insane though, this could be by far the best framework for prototyping or simple projects in general
You have the entire power and flexibility of Python available to you to refactor and structure your application however you like. So don't create things that are horrible to maintain!
Awesome, will try today. I have several streamlit apps, ready to convert. Can you comment on reflex vs fastHtml vs streamlit, and production deployment?
I really like the approach of building on what htmx does really well. I will remark that this one file python app also will have to engage with python's extensive nest of package management systems and their configuration files... now am I using poetry, pip or was it setuptools...what is a pyproject.toml file...
You typically do not worry about HTTPS directly inside a web app but instead handle that in a reverse proxy up front. Or let the cloud provider handle that for you (I'm assuming that the built in shortcuts for deploying to cloud providers will take care of this).
No - but there's no need to; you can deploy to Railway or Vercel and then you don't need to worry about converting to a static site. With the Python `@cache` decorator everything will be rendered just once and stored in memory.
@@Z3U5.0g It cost me $0.05 in Railway hosting costs for all the experiments I ran for getting FastHTML set up over a month. So no I don't think the cost difference need be that significant!
My impression is that a lot of people are leaving static (JAM-stack) for serverless hosting of dynamic code. Especially if your website has a large number of pages. Generating all those static pages can become a very tedious process. With a python app you just update the relevant code and deploy instantly. This is the way forward for many.
Wait what, i was actually planning on using FASTAPI and React for my startup, React made me go nuts with its constant changes. I'm genuinely confused because i invested almost 6 months into learning react because i had to. What should i do ?
It's good, but like again a python frontend dev might find it difficult to then work on Java frontend, Go frontend, JS frontend. Also, UI changes will also need building the entire app and re-deploying everything, if the app is not truly stateless then re-deploying can't be done just any time.
Deploying dynamic code to cheap serverless hosting providers is a better and more (doh) dynamic and simpler approach for many of us. Take a small hit and pay a few cents a month depending on the amount of traffic you get. And leave that (sometimes very lengthy) build process behind while gaining access to all the good stuff that you get from python and pip! Bravo! I still haven't used FastHTML and I have no affiliation of any kind. I'm just excited to learn that this now exists!
Wanted to add that for a high traffic website you should use a CDN anyway and that should make it very cost effective and highly reliable. Just remember to invalidate the cache when you make changes.
Yes! Rails has similar goals to FastHTML -- although I do believe we've managed to keep things easier to use and understand than Rails (although I'm very biased of course).
I looked into it and it seems you need to write js in multi-line strings. Is there a way to circumvent this? Are you planning on making it "fully python" code?
Rip to people who believe web development is simple. Rendering html is not a web development, how about saving data to database, securing users from various attacks and so on…😂😂
im really glad that we still have people fighting for simplicity over complexity in the web world
except this is not it.
simplicity??????
@@JonathanCrossland
exactly, I dont see the point of creating html structures in a python route when you should easily return a simple html template or partial.
not only its more easy to understand it for a whole dev community out there but also makes everything more modular in terms of stack migration and compatibility with other frameworks. now this is a big fruit salad.
what hypermedia frameworks really need is a ui library focused on premade html templates that can be easily copy pasted and have a collection of versatile routes functions dedicated to the big backend stacks out there like nodejs python php and java.
I really would do it if I didnt have so many projects in my hands already.
Wow! This is huge. As a data scientist I realized that I need to learn some web dev to become more versatile; however it is a lot to learn and a lot of time invested plus having a full time job and family. It seems to be a great shortcut, I am going to try it out.
I was just thinking the same thing, looking at my stack of books. Time and life.
Backend here in multiple languages at first I was against learning frontend development and js/ts. Start small bud just learn basic HTML, css and js. Freecodecamp curriculum or traversy 30 projects course is perfect. You don’t need to learn npm, react and fancy stuff. If you ever need more then learn a frontend framework. Trying to stay in python for everything is swimming against the current and limits what you can do.
nice... every time new delightful goodies... nbdev, fastai, APL intro, now FastHTML - thanks so much Jeremy!
I like how we engineers, like to reinvent things, every 5 years we go through cycles of simplifying things, then as complexity of requirements grow we get back to the status quo :) Feels like reimplementation of GWT and co, with similar benefits and downsides.
No not at all similar to GWT. Totally different approach. This is closer to elixir phoenix liveview, or ruby hotwire. But not really the same as them either -- much simpler and closer to the bare bones of the web.
Thinking the same lol, like it would have been faster to just learn frontend but nope need a library in python.
this a ideological approach not a practical one.
It's the grand unified framework of everything that physists have been seeking!
Elegant and productive framework, it's been exciting to contribute!
Wow ... streamlit has been my most favorite but this is looking really great... I love the simplicity of streamlit if you guys can magic the simplicity of streamlit into fasthtml with your genius thinking it would be a revolution i think... Thank you very much...
If it can resolve 2 pain-points: deployment and auth, I am to ready convert
I always thought about this idea where all the web components would be unified. This is really cool!
It's the grand unified framework of everything that physists have been seeking!
Reading through the comments here, you have obviously produced something amazing and wonderful. If I understand it correctly, your program can make web-pages in HTML. And you built it in Python. Well done! I am assuming from the comments that building a web page this way is faster than writing one in HTML. So well done! Keep up the good work.
simple & beautiful, already feels less clunky than some other python wrapper-based frameworks. Excited to try it out, been a fan of your courses and work. Thank you Jeremy!
This is fantastic! My dream is for web development to evolve into a process where humans can design in a style similar to using Figma and propose functionalities in plain language, with AI connecting the front-end and back-end work somehow. In this ideal world, the coding required for non-computer scientists or IT professionals (like me, a creative and curious human being) would be minimal, perhaps limited to just HTML or CSS for styling. I’d love to bring my ideas to life without the steep learning curve of coding. That would be amazing someday… (Let me dream). I’m really excited that your work seems to be moving in this direction. Thanks for sharing!
but why waste time? you can hire web devs for very cheap. 10 usd for a react web app.
Great video!
this is good thing for data nerds, no need to learn huge tech stacks 😎 for their apps
Still a bit abstract for me. I could better relate if you converted a streamlit app to FastHTML. I'd feel more grounded if I could compare the two source codes.
That's a great idea! I will look into doing that.
@@howardjeremyp Please hurry! And thank you!!
😂 says the Python dev writing websites
I’ll be here for that
Yeah, I find it's not looking that much simpler than just using HTML. Though it's cool. And for some functions, less code. But more to learn.
This is lovely! I love how simple it is
XHTML integration won me over. Such a clever use of JS to avoid JS.
Introduction to Fast HTML - 00:00:01
Demo of Fast HTML Capabilities - 00:00:10
Benefits and Use Cases of Fast HTML - 00:01:08
Comparisons with Other Web Frameworks - 00:01:37
Creating a To-Do Web Application - 00:03:14
Defining Routes and Components - 00:03:46
Using Templates and Python Functions - 00:04:12
Adding Interactivity with HTMX - 00:04:40
Adding Persistency with SQLite - 00:05:15
Enhancing UI and Functionality - 00:05:51
Expanding Features and Components - 00:06:22
Authentication and Deployment - 00:06:53
Documentation and Examples - 00:07:24
Thank you!
Just recreated the todo app i'm loving it!
wow, I had no idea Instagram was written in Django!! Thank you for the great video!
This is awesome! I am really looking forward to see where this goes, it's getting a lot of hype
Awesome !!!!
Wow! looking into the docs and more examples! Thank you for sharing this!
supper intresting ; learning ...
I am looking forward to where FastHTML goes... I love Django and HTMX, but for most use cases I can see FastHTML and SQLite being more than enough - especially with the ease of HTMX interaction...
this looks amazing honestly
I think a comparison to streamlit will be a nice idea to promote this framework. Streamlit is extremly laggy for my usecase as I have to constantly to update my ui so I will def give a try to your framework. Thank you for awesome job!
That's a really cute video to go with an awesome tool. Thanks!
Finally, you create it, thank you very much :-)
Wow, a Jeremy Howard video under 2 hrs 😂❤
This is awesome! I'd love to see how we can integrate mongodb with this!
Websim AI is currently the real deal in web development.
Great work!! atlast, python for everything ❤
Nice intro to FastHTML, I would like to know more about the performance in terms of memory and latency, where I can find more info? Thanks!
Finally I can do web programming
So excited to try this out on my little app
You had me at "easy to deploy"
Interesting, will give it shot
Impressive!
Python based web development would be awesome, but as a python first coder that has used Flask/Django. I've found that my biggest pain point is that the frameworks are very difficult to deploy as they require continuous server operation at scale, whereas javascript can be deployed as a static file in a CDN run on the client and then scales really well with stateless apis built into cloud functions in any language you like that aren't constantly running and can be scaled up on demand. I started with Django and Flask and have deployed on python anywhere, but I found it very challenging to get the architecture to work once I built the app even though it was way faster to build the app. I didn't find that the code or the framework was my issue. I would really like to see a very quick and easy way to deploy python apps that used WASM (I know nothing about WASM) or had a framework that could be deployed to cloud functions not servers in a stateless way with javascript scaffolding? I believe deployment is why people don't build many web apps with python. If you look at streamlit/mesop they are fine, but deployment is not easy.
Huh, this is quite a refresher to hear! Or at least I think so… HTML/CSS/JS is the bare I hear to start web 'dev-ing',
and just like the meme, that is what I first thought cuz technologies like frameworks got me a little worried of how much I actually need to learn…
From what I understand, frameworks are almost like Linux distros. Now, the reasons I want to learn python is largely of the influence by the Blender foundation.
This 'FastHTML' as I understand it, unifies already established web components… And with python in the mix… Well, this might be my cup of tea after all :)
-
Although I'm getting ahead of myself as I'm still far from my journey to be coming a web dev, lmao. 😅Just sharing my enthusiasm.
I guess lastly… Why the name 'FastHTML'? When it's obviously more than just HTML. Is it to emphasise it's almost as fast as HTML?
Real cool, I’m no web dev, but sometimes I need to create some basic ui for my projects, big fan of HTMX, I’ve used it with Flask, is there a learning curve in using your library in my use case?
We've seen web devs with similar backgrounds write useful apps within an hour of 1st starting with FastHTML.
If this framework was inspired by other ones, it would be nice (or ...) to mention them somewhere as well.
Mentioned in detail at about.fastht.ml
This is cool - the main problem I have found with most of these Python -> HTML frameworks is that I almost always want two way bindings between a chart (Plotly for example) and the app. Does FastHTML support this in some way? I just want to interact with my selected data points without having to write a react app or use Dash lol
Yes it does, but not through a reactive design, but through responding to standard JS events. FastHTML doesn't add new abstractions on top of web standards, but instead makes those standards more easily available.
This is awesome!
Nice! How about security? And can I take this to production right away?
A framework can't fully handle security for you, but we certainly thought carefully about it for FastHTML. `examples/adv_app.py` in the FastHTML repo shows an example of custom authentication along with notes on how it works.
It should be production-ready, although obviously since it's very new, it's less well-tested in practice. Most of our sites run on it now.
@@howardjeremyp awesome. Time to get my hands dirty with FastHTML.
Writing hmtx and html-ish code right in your controller looks horrible to maintain. I already had some issues with django's forms for that but this goes way deeper into the concept. I would love to hear your thoughts on this
The speed at which you can get things running looks insane though, this could be by far the best framework for prototyping or simple projects in general
You have the entire power and flexibility of Python available to you to refactor and structure your application however you like. So don't create things that are horrible to maintain!
Love this
Very cool! Does this utilise pyscript at all? Haven't read the docs yet so sorry if its covered there
Nope.
Awesome, will try today. I have several streamlit apps, ready to convert. Can you comment on reflex vs fastHtml vs streamlit, and production deployment?
awesome pretty cool!
Looks good, I’m a big fastai fan, but I’m not sure if I would switch from using plotlys dash to this. Is there a compelling improvement?
Alright. lets try this
I really like the approach of building on what htmx does really well. I will remark that this one file python app also will have to engage with python's extensive nest of package management systems and their configuration files... now am I using poetry, pip or was it setuptools...what is a pyproject.toml file...
how does it handle working with https?
You typically do not worry about HTTPS directly inside a web app but instead handle that in a reverse proxy up front. Or let the cloud provider handle that for you (I'm assuming that the built in shortcuts for deploying to cloud providers will take care of this).
Can I create a static site using this framework and host it on services like S3?
No - but there's no need to; you can deploy to Railway or Vercel and then you don't need to worry about converting to a static site. With the Python `@cache` decorator everything will be rendered just once and stored in memory.
@@howardjeremyp Okay but don’t you think static storages are cheaper than running a web server?
@@Z3U5.0g It cost me $0.05 in Railway hosting costs for all the experiments I ran for getting FastHTML set up over a month. So no I don't think the cost difference need be that significant!
My impression is that a lot of people are leaving static (JAM-stack) for serverless hosting of dynamic code. Especially if your website has a large number of pages. Generating all those static pages can become a very tedious process. With a python app you just update the relevant code and deploy instantly. This is the way forward for many.
hi.. .. wil it require some programmes to be installed on the server ?? and will it work on LAN without internet ?
You can run it locally -- only Python is required. No internet needed.
All I need is somthing like babel to translate the jsx into python functions
It exists! h2f.answer.ai/
this rocks
Can't figure out what is being typed onscreen. The font is too small and the video doesn't seem clear :-(
is backend admin pannel available like django in FastHTML?
How about complex web apps? Are you gonna reinvent the wheel now?
Quite the opposite - this simply uses the wheels we already have, and makes them more accessible and usable: HTTP and HTML.
Wait what, i was actually planning on using FASTAPI and React for my startup, React made me go nuts with its constant changes. I'm genuinely confused because i invested almost 6 months into learning react because i had to. What should i do ?
learn Svelte
@@luisrueda4476 Thank you, I'm quite good with Svelte, Don'y you feel like these frameworks are going down?
Want to see it implemented in a Swift, like SwiftUI
It's good, but like again a python frontend dev might find it difficult to then work on Java frontend, Go frontend, JS frontend. Also, UI changes will also need building the entire app and re-deploying everything, if the app is not truly stateless then re-deploying can't be done just any time.
This definitely is what I needed long time ago. Not sure now.
Excelent framework! could you please share the code editor color theme at 00:39 ? I really like it
there is built in log in and log out in browsers?
Like Emacs for the web???
Isn't something called reflex aside by side comparison would be good
CDN delivery??? After polyfill gate?
How to create static html pages and deploy on github pages?
My view is you probably don't need static html pages any more -- so this doesn't support that approach. If you want an SSG then I recommend Quarto.
Deploying dynamic code to cheap serverless hosting providers is a better and more (doh) dynamic and simpler approach for many of us. Take a small hit and pay a few cents a month depending on the amount of traffic you get. And leave that (sometimes very lengthy) build process behind while gaining access to all the good stuff that you get from python and pip! Bravo!
I still haven't used FastHTML and I have no affiliation of any kind. I'm just excited to learn that this now exists!
Wanted to add that for a high traffic website you should use a CDN anyway and that should make it very cost effective and highly reliable. Just remember to invalidate the cache when you make changes.
Gradio , StreamLit not fasthtml , whats the difference when to use which
Dayum
Why are there `main.py` and `todos.py`? Are they just a copy of each other?
Second! :)
i don't know why but it reminds me RoR scafolding. same vibe.
Yes! Rails has similar goals to FastHTML -- although I do believe we've managed to keep things easier to use and understand than Rails (although I'm very biased of course).
jeremy is god
Is this like FastUI?
No.
How long before this turns into react. :D
John Cena short -> Are you sure about that? really? reaaalllyyy?? omg
Can I interact with the DOM?
I looked into it and it seems you need to write js in multi-line strings. Is there a way to circumvent this? Are you planning on making it "fully python" code?
Yes you can respond to any event on any element with python code that can update the DOM any way you like.
You don't need js, but you can use js if you like. If you use it, you can put js in separate files, or inline.
what kind of wizardry is this?
what do you think! is it better fast html or flask?
Third :)
first! :)
Skill issue glaring me in the face
yet another "my way is the right way"
bruh these people look AI generated, wth
Wait what? You mean me? I'm nearly an entirely real person, I assure you
@@howardjeremyp is the most advanced I have ever beheld.
Web developers are a shame to the software development community
damnit... jsut made py look coo... oh wait. its still krap
damn... this is so overly complicated, verbose than HTML, CSS... 😂
Rip to people who believe web development is simple. Rendering html is not a web development, how about saving data to database, securing users from various attacks and so on…😂😂
Don't gate-keep please. FastHTML comes with examples of DBs and security, and they aren't difficult to learn or use.
SQLite is not called database 🙏
Don’t want to be gatekeeper as well but tell me one production ready app which can serve huge user base? Did you created fasthtml site on it?
There is much wisdom behind simple, readable implementations when it comes to maintaining anything yourself.
Hey Jeremy, I want to acknowledge your good work. I’m just trying to understand how far it’s ready to make a real work applications.
python? really?