Getting started with FastHTML

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 พ.ย. 2024

ความคิดเห็น • 139

  • @TheFocusedCoder
    @TheFocusedCoder 3 หลายเดือนก่อน +66

    Wow I’ve waited decades for something like this in python . This is huge

    • @stalepalemale
      @stalepalemale 3 หลายเดือนก่อน

      Web dev using Python is not new, theres Python Reflex (which used to be Pynecone) and NiceGUI, Taipy, Streamlit but great to see this new entrant too.

  • @nerdg2
    @nerdg2 3 หลายเดือนก่อน +25

    I have no regrets, learning python finally is about to pay off! I'm a javascript developer and i had enough! Thank you

    • @DavidBerglund
      @DavidBerglund 3 หลายเดือนก่อน +4

      @@nerdg2 it'd be interesting to see if this takes off in a big way. I've had full stack roles before where I had to learn a huge amount of front end technologies just to change some simple things on a website. Despite wanting to build web apps I got so fed up with it that I looked for a way out. Moved to backend with python and later to sysadmin. Running away from the front end and screaming. :P HTMX and FastHTML makes me interested in web dev again.

    • @nerdg2
      @nerdg2 3 หลายเดือนก่อน +3

      ​@@DavidBerglund 100% agreed, its like you read my mind. I had to learn tons of new bs just to throw them away after a tiny version update, AngularJS gave me ptsd lol. Svelte was the only sane framework i got to use.
      I think HTMX coupled with alpinejs should do wonders, i mean whats wrong with VanillaJS, ES6 & ES7 does wonders.
      I'm about to go full FastAPI and FastHTML on my new startup, i'm a 1000% commited now.

    • @DavidBerglund
      @DavidBerglund 3 หลายเดือนก่อน +2

      @@nerdg2 sounds that it could be a fun place to work :) Good luck!

  • @aristoi
    @aristoi 3 หลายเดือนก่อน +6

    I'm always excited everytime you introduce something new Jeremy. Appreciate you.

  • @alexandermaier2218
    @alexandermaier2218 3 หลายเดือนก่อน +13

    Awesome work! Perfect for prototyping and more fast fun projects!

  • @andreroodt4647
    @andreroodt4647 3 หลายเดือนก่อน +22

    I'm not a Python developer, but I love this. I'll be crucified for saying this, but It takes me back 25 years to a time when we streamed HTML from our Java servlets, and JavaScript was something the kids used for scrolling text and popping up banners 🙂. Then, before we knew it, the kids replaced the View in MVC with another nested MVC with its own entire ecosystem, and we "full stack" devs were relegated to the back end.

    • @andreroodt4647
      @andreroodt4647 3 หลายเดือนก่อน +9

      Wow, I sound like a bitter boomer, but I'm not. It's just refreshing to see a simpler alternative to the complexity that is synonymous with front-end development.

    • @michaelnurse9089
      @michaelnurse9089 3 หลายเดือนก่อน +4

      @@andreroodt4647 Nah. You sound fine. Never doubt yourself.

    • @DavidBerglund
      @DavidBerglund 3 หลายเดือนก่อน +1

      ​@@michaelnurse9089 "never doubt yourself" is terrible advice 😂 But yes, modern front end dev is amazingly complex and this approach looks very interesting for python devs.

    • @DavidBerglund
      @DavidBerglund 3 หลายเดือนก่อน +3

      I've been hoping that someone built an abstraction on top of HTMX

    • @thinkerisme4363
      @thinkerisme4363 3 หลายเดือนก่อน

      great 👍

  • @audreyroygreenfeld6972
    @audreyroygreenfeld6972 3 หลายเดือนก่อน +17

    Tip: if you get "Internal Server Error" around 31:43 when loading the Todos page, delete todos.db and try again. If that still happens, check carefully which parameters you passed into Todo(). Unlike Titled() which accepts a string by itself as the first argument, Todo() here requires the "title=" named keyword argument.

    • @MannyBernabe
      @MannyBernabe 3 หลายเดือนก่อน +1

      Thanks. Deleted todos.db and re-ran. Fixed.

    • @yubrshen
      @yubrshen 3 หลายเดือนก่อน +2

      Watching closely, the error was introduced when inserting without record id and primary key with the id. Once that is corrected, the insertion will work.

  • @CodingIsFun
    @CodingIsFun 3 หลายเดือนก่อน +5

    *Wow! Amazing work!* 🤩 As a heavy Streamlit user, this looks very interesting and promising. I gotta try it out!

  • @bubelevakalisa7313
    @bubelevakalisa7313 3 หลายเดือนก่อน +2

    For someone like me who hates JavaScript with passion, this is soooo beautiful👌🏾

  • @JulianHarris
    @JulianHarris 3 หลายเดือนก่อน +8

    Server side dynamic web pages with a single file. Now I see why you were challenging the status quo a few months back!

  • @ravishmahajan9314
    @ravishmahajan9314 3 หลายเดือนก่อน +1

    This is good for python community who want to get started with web development using python.

  • @HerroEverynyan
    @HerroEverynyan 3 หลายเดือนก่อน +2

    Omg, this is perfection and exactly what I needed! Thanks so much Jeremy & co. Long time fan btw ❤

  • @wilsonusman
    @wilsonusman 3 หลายเดือนก่อน +4

    This is game changer for prototyping FAST!

  • @HarishPillay
    @HarishPillay 3 หลายเดือนก่อน +2

    Thanks for posting this, Jeremy. It's a refreshing way to build web apps.

  • @viorelteodorescu
    @viorelteodorescu 3 หลายเดือนก่อน +2

    Excellent idea and contribution to the python world! 😊

  • @tamtamresearchs.r.o.5562
    @tamtamresearchs.r.o.5562 3 หลายเดือนก่อน +1

    Finally things look simple and clear for how to use Python for authoring HTMX based apps. Very nicely explained with all the responses, local updates, out of band updates etc.
    On the other hand - I am getting sick from optimization on number of lines of code (one liners for def, if; star imports), breaking PEP8.

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +1

      Actual quote from PEP8: "A Foolish Consistency is the Hobgoblin of Little Minds".

    • @smibssmibs
      @smibssmibs 2 หลายเดือนก่อน +1

      @@howardjeremyp Quoting Wikipedia: "A hobgoblin is a household spirit ... once considered helpful, but which since the spread of Christianity has often been considered mischievous." Regarding PEP8, I am still in the earlier stage and consider it helpful.
      Thanks for your work anyway - it strongly simplifies HTMX templating in very creative way and this is helpful too.

  • @dazraf
    @dazraf 3 หลายเดือนก่อน +3

    This is wonderful, thank you Jeremy!

  • @melonkernel
    @melonkernel 3 หลายเดือนก่อน +4

    Nice Jeremy! Lovely tutorial for a lovely framework

  • @MKBergins
    @MKBergins 3 หลายเดือนก่อน +2

    I love this, thank you for making this. I hate HTML, CSS, JavaScript, and mostly familiar with Python and C#. I'm glad I can now finally (hopefully) use Python to make a website. I believe there might be a way to even use the 'fastHTML' page to call on some Django-made pages or other logic, right? Would be awesome to get some more in-depth tech documentation.

  • @fabriai
    @fabriai 3 หลายเดือนก่อน

    This is extremely good. I’m: reliving the “building a blog in 15 minutes” moment I had many years ago when Rails was presented. But Jeremy is much more charismatic than DHH.

  • @FazalKareem-b4e
    @FazalKareem-b4e 3 หลายเดือนก่อน +1

    This is really cool! Finally python is paying off. But one concern is that I went to the deployed app from this tutorial and tried using it. The app seemed very slow for a simple to-do list app. It was taking a moment to add or delete new todo. Makes me worry about how slow bigger projects would be.

  • @TrashallAllsites
    @TrashallAllsites 2 หลายเดือนก่อน +1

    super finally we can prototype application quickly for machine learning Algorithm

  • @MichelSpeiser
    @MichelSpeiser 5 วันที่ผ่านมา

    Very cool! The only thing I am not a fan of is this oob swap at the end, seems like clearing the input should not require returning anything

  • @salmanahmed8039
    @salmanahmed8039 3 หลายเดือนก่อน +7

    hey jeremy, this is an amazing idea and I can see it going to be a great way of Development in future. Do we have comparisons on response time of FastHTML with others like react?

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +6

      No I haven't done anything like that, because it varies so much based on what you do and how you do it. But for most apps, latency of both react and fasthtml should be low enough to be a non-issue for users.

  • @Quantum_Nebula
    @Quantum_Nebula 3 หลายเดือนก่อน +3

    I love this a lot! I am wondering how much customization there is in fastHTML. Do you mind going over some more advanced styling, and/or transitions?

    • @michaelnurse9089
      @michaelnurse9089 3 หลายเดือนก่อน +2

      The default styling options are probably minimal. You can always insert JS elements and so have access to near infinite styling options if that is what you need. Most viewers don't care for fancy styling.

  • @Archibong.samuel
    @Archibong.samuel 3 หลายเดือนก่อน +1

    Finally Python has done some remarkable.

  • @hcholm
    @hcholm 3 หลายเดือนก่อน +1

    Would love to see some kind of bigger reference project with a complex data model, a lot of components, various customisations etc.

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +2

      github.com/AnswerDotAI/fasthtml/blob/main/examples/adv_app.py

  • @hemanthhvv4296
    @hemanthhvv4296 2 หลายเดือนก่อน +1

    I'm in thought like this thing (frontend in django is not efficient ) , here comes FASTHtml , that's great

  • @kora5
    @kora5 3 หลายเดือนก่อน +3

    You are using Cursor with its Copilot++, right? Any review?

  • @yannawel
    @yannawel 3 หลายเดือนก่อน +1

    Looking forward to getting into it!

  • @simonlauer9379
    @simonlauer9379 3 หลายเดือนก่อน +1

    is there support for things like templates?
    I kind of still like the separation it brings to the table
    big fan of htmx though

  • @ryank42301
    @ryank42301 3 หลายเดือนก่อน +1

    Fantastic work. Huge thx!

  • @GeneratedElectricity
    @GeneratedElectricity 3 หลายเดือนก่อน +1

    Well I recently learned MERN myself. As a new developer, should I learn this? Because it seems so interesting.

  • @vibhumawasthi
    @vibhumawasthi 3 หลายเดือนก่อน +2

    looks great!!
    I am new to all this, I have learend python for data analysis and also learned fastAPI for backend, can I use it for frontend with fastAPI to create a full stack app?

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +3

      You can use FastHTML for both frontend and backend to create a full stack app :D

  • @chuckinator0
    @chuckinator0 3 หลายเดือนก่อน +1

    Does railway have any tools to manage the SQLite database? Backups, etc?

  • @ハェフィシェフ
    @ハェフィシェフ 3 หลายเดือนก่อน +1

    25:20 you said you can make the page respond to scrolling or moving the slider. How would you do that?

  • @end1dream
    @end1dream 3 หลายเดือนก่อน

    Amazing stuff!
    How would one load Google Maps into a here?

  • @abdurahmanayesha608
    @abdurahmanayesha608 3 หลายเดือนก่อน +2

    it woud be nice if can use this with fastapi, a python framewor

  • @imaginatecstv
    @imaginatecstv 3 หลายเดือนก่อน +1

    Well, that's a great overview. Thank you so much!! We use DRF to create rest APIs using Django. And FastAPI to create rest APIs too that can be consumed by any frontend/client for that matter. What's up with this one? Can we do that stuff? If so or not, can you please make a walkthru in that perspective? Or is this like plain-old standalone Django with just templates that serve only HTML with no rest APIs?

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +1

      It's neither of those things -- it's something new! You can do the same stuff that you do with DRF/FastAPI with a js frontend, but you don't need to write any js frontend. There's about a dozen examples and walkthrus in the repo so take a look.

    • @imaginatecstv
      @imaginatecstv 3 หลายเดือนก่อน +1

      @@howardjeremyp Oh god. That's a Triple BAM!!! Lovely one. Will take a look. So indebted for this to you Jeremy❣

  • @invictus56
    @invictus56 3 หลายเดือนก่อน +1

    Holy Moly, your webcam is amazing! What are you using?

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +4

      I'm using an iPhone 14.

  • @owenlamont4397
    @owenlamont4397 3 หลายเดือนก่อน +1

    Curious to learn how this compares to Sameul Colvin's FastUI - similar name and you both seem to be aiming for a similar developer experience of writing low boilerplate web apps purely in Python and you both mention being FastAPI/htmx inspired.

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +2

      FastUI is great, but uses a totally different approach. Try both and see what you like best!

  • @praveenhamal
    @praveenhamal 2 หลายเดือนก่อน +1

    hey how to get input from user?
    Input("Name",id="username")

  • @rayallinkh
    @rayallinkh 3 หลายเดือนก่อน +1

    is the way it's passing back objects to app through a tuple really scalable? not sure how this works out beyond toy demos

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +1

      Yes, it's more scalable in fact, since you can use the full power of python to refactor. Also the actual size of the html partials sent over the wire are often more compact than json APIs, and the browser has far less work to do -- there isn't a "hydration" process.

  • @Lily-wp5do
    @Lily-wp5do 3 หลายเดือนก่อน +1

    Hi Jeremy, thanks for sharing this. I love it. I try to follow your video but I couldn’t find the todos.db. could you share it? Thanks.

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +1

      It's auto-generated when you run the app.

  • @ravishmahajan9314
    @ravishmahajan9314 3 หลายเดือนก่อน

    In order to have wider adoption of this wonderful library, we need to solid documentation so that people can take it from day one. For now, i am just struggling for get hand on

  • @Kevin-hk4fv
    @Kevin-hk4fv 3 หลายเดือนก่อน +1

    Amazing!

  • @eitanporat9892
    @eitanporat9892 3 หลายเดือนก่อน +2

    hey jeremy how did the html app know to create a Todo item when filling out the form?

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +5

      Great question! It's because the `Todo` type annotation is there. So FastHTML tries to create an object of that type using the named items in the form.

    • @eitanporat9892
      @eitanporat9892 3 หลายเดือนก่อน +1

      ​@@howardjeremyp thanks!

  • @JohnEgan-k8q
    @JohnEgan-k8q 3 หลายเดือนก่อน +1

    thank you Jeremy

  • @Pete_YT
    @Pete_YT 3 หลายเดือนก่อน

    Would progressive web app features work with this such as SPA to provide navigation without reloads and access to device features on mobile such as offline storage on device with indexedDB or WebSQL on device?

  • @watsomk
    @watsomk 3 หลายเดือนก่อน +1

    It appears that link in the description mistakenly includes the trailing closed parenthesis.

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +1

      Thanks! Fixed now. I always make that mistake...

  • @jwithy
    @jwithy 3 หลายเดือนก่อน +2

    What is the hotkey Jeremy uses to jump from a function to its code? 28:04

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +1

      Hold down cmd or ctrl and click the name.

    • @maxim_ml
      @maxim_ml 3 หลายเดือนก่อน +1

      that's just ctrl+click
      Do you know what he's using at 20:59?

    • @jwithy
      @jwithy 3 หลายเดือนก่อน +1

      ​@@howardjeremyp thank you 🫶...from FastAI to FastHTML I'll be there

  • @Yeahmansingh
    @Yeahmansingh 3 หลายเดือนก่อน +1

    thanks jeremy

  • @__________________________6910
    @__________________________6910 3 หลายเดือนก่อน +1

    Like Gradio, can we run FastHTML in Google Colab without using ngrok?

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +1

      Not to my knowledge -- or at least I haven't seen that done yet. Gradio has some nifty tricks to make that work that we don't have in FastHTML!

    • @__________________________6910
      @__________________________6910 3 หลายเดือนก่อน +1

      @@howardjeremyp Okay, by the way, FastHTML is great. Even if you only know Python, you can still create websites or web apps with it 🔥

  • @booster404
    @booster404 3 หลายเดือนก่อน +2

    can this fastHTML mix with tailwind css ??

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +2

      Yup for sure. That FastHTML home page uses tailwind, for instance.

  • @helloworldcsofficial
    @helloworldcsofficial 3 หลายเดือนก่อน +1

    Awesome.

  • @mohammadrashid1994
    @mohammadrashid1994 2 หลายเดือนก่อน

    I have been thinking about this idea for quite a while. A very huge first step. Thanks.
    However we need a neater approach to code interactive web with Python. I would focus on interactivity, component based architecture, existing styling frameworks and browser-Python compatiblity first rather than database and backend.
    Well done. Wish you best of luck. I'm looking forward for the day where I will use Python for my entire web app with fair confidence.

  • @FlowBuddyApp
    @FlowBuddyApp 3 หลายเดือนก่อน +1

    Cool thing Jeremy :)

    • @FlowBuddyApp
      @FlowBuddyApp 3 หลายเดือนก่อน

      the ) does not escape in the link in the description :D

  • @tonynguyendtn1984
    @tonynguyendtn1984 3 หลายเดือนก่อน

    hey guys. i'm an accountant and a python hobbist. are there any resources on the internet on how I can contribute to this project?

  • @harrycblum6344
    @harrycblum6344 3 หลายเดือนก่อน +1

    Cool!

  • @riccardomenoli5185
    @riccardomenoli5185 3 หลายเดือนก่อน +4

    Does it make sense to use FastHTML as pure frontend that calls an API backend created with FastAPI?
    I see that here FastHTML is kind of doing both frontend and backend.

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +4

      No it doesn't - FastHTML is designed for hypermedia applications, which is the design we recommend most people use for most projects. If you want to split out the API and deal with the complexity of that approach, then you should use something designed for that.

  • @jakemcpeterson
    @jakemcpeterson 3 หลายเดือนก่อน +1

    Very cool

  • @infraia
    @infraia 3 หลายเดือนก่อน

    Thanks Jeremy

  • @hoopscircle-dj6sk
    @hoopscircle-dj6sk 3 หลายเดือนก่อน

    This is dooe !!

  • @MyOldNewYork
    @MyOldNewYork 3 หลายเดือนก่อน +3

    I love it but wouldn't it be better to make Div, A, P etc. lowercase since Python is mostly written in lowercase and HTML also is lowercase?

    • @balojey
      @balojey 3 หลายเดือนก่อน +4

      Maybe, you don't know!
      Div and other components are classes and it is a convention in python that all classes name must start with a capital letter.
      Functions and other variables may be in lowercase but classes must be capitalised.
      This is a convention and it is not compulsory to adhere to it. However, FastHTML follows this convention which improves the understanding of the project structure by python developers.

    • @DavidBerglund
      @DavidBerglund 3 หลายเดือนก่อน +1

      This bugged me as well. htpy is a package that generates HTML and it uses lowercase. I like how it looks but I'm not sure how complete it is or limiting etc

  • @omlachake2551
    @omlachake2551 3 หลายเดือนก่อน +1

    my
    hx_swap_oob="true"
    becomes
    hx-swap:oob="true"
    when rendered to HTML. And because of that issue the Input field is not cleared. Does anyone know how to solve this issue?

    • @omlachake2551
      @omlachake2551 3 หลายเดือนก่อน +2

      Solved it be passing the attribute as Input(**{'hx-swap-oob': 'true'}). But if anyone could point why this happened, it will a lot.

    • @sjvonstein
      @sjvonstein 3 หลายเดือนก่อน +2

      ​@@omlachake2551 without your suggestion, the input box would not clear and the input field was being returned to the end of the list.

  • @Larimuss
    @Larimuss 3 หลายเดือนก่อน

    Really cool idea. I think with more work and simplified commands could be great. Right now, it's probably good for pythons devs for small projects but not something I'd expect to see in many production sites. Code seems just as complex as righting out the html. Especially with all the tools available now. Html5 is super simple.

  • @mayfield7835
    @mayfield7835 3 หลายเดือนก่อน

    very nice

  • @frag_it
    @frag_it 3 หลายเดือนก่อน +1

    Does this replace flask ?

    • @howardjeremyp
      @howardjeremyp  3 หลายเดือนก่อน +1

      It can do, yes -- whether it's better than flask for your particular needs is something you'll need to try to find out though.

    • @frag_it
      @frag_it 3 หลายเดือนก่อน +1

      @@howardjeremyp thanks looking for something robust to build a full scale production app with the flexibility of css js and html for the frontend and robust flask app for back end applications

    • @DavidBerglund
      @DavidBerglund 3 หลายเดือนก่อน

      ​@@frag_itthen you're surely not going to pick this brand new shiny thing. Go with Flask/Django/FastAPI+Templates and HTMX. Proven tech. I'm saying this being genuinely excited about FastHTML

    • @DavidBerglund
      @DavidBerglund 3 หลายเดือนก่อน

      ​@@frag_itmaybe don't jump on a new shiny web framework for a new production app when you can use a more mature framework like Flask or Django with HTMX if you like. I'm excited for the future of this project though. But then again, if this framework let's you build and test and iterate on your ideas quickly. Why not!

    • @frag_it
      @frag_it 3 หลายเดือนก่อน +1

      @@DavidBerglund yes that’s true flask works well but as uy said good for further iteration

  • @nikjs
    @nikjs 3 หลายเดือนก่อน +1

    prediction: we may have AI frontend generators that use fasthtml to do the job.

    • @Femiway_Bunty
      @Femiway_Bunty 3 หลายเดือนก่อน

      like a better 'figma to code'

    • @PatrickSteil
      @PatrickSteil 2 หลายเดือนก่อน

      Had same idea!

  • @simonsery4450
    @simonsery4450 3 หลายเดือนก่อน +1

    This is insane...

  • @BharatKaNamaste
    @BharatKaNamaste 3 หลายเดือนก่อน

    Its tooo hard😮

  • @gw1284
    @gw1284 3 หลายเดือนก่อน +1

    Awesome, tutorial, How to 1) incorporate Login 2) integrate with a react component? Thanks

  • @SamiSabirIdrissi
    @SamiSabirIdrissi 3 หลายเดือนก่อน +1

    5k views in 21hrs 😮

  • @IncompressibleOnboarding
    @IncompressibleOnboarding 3 หลายเดือนก่อน +1

    Link includes the right ) FYI

    • @ioftheneedle
      @ioftheneedle 3 หลายเดือนก่อน

      Lol was about the write the same.

    • @avtargill
      @avtargill 3 หลายเดือนก่อน

      Move FastHTML and break stuff 😤

  • @i_youtube_
    @i_youtube_ 3 หลายเดือนก่อน

    Side question: As a beginner, what do I need to learn to contribute to this project? I know python and web development. Still I didn't learn git and other things.

  • @bossgd100
    @bossgd100 3 หลายเดือนก่อน +1

    Are u using mojo to run it ?

    • @eitanporat9892
      @eitanporat9892 3 หลายเดือนก่อน +1

      mojo is a new programming language for performant parallel applications running on gpus, it's not related to webdev.

    • @bossgd100
      @bossgd100 3 หลายเดือนก่อน

      @@eitanporat9892 thank you, it's more clear now

  • @sigmaroll9802
    @sigmaroll9802 3 หลายเดือนก่อน

    Calc!

  • @pookiepats
    @pookiepats 3 หลายเดือนก่อน

    Too bad it’s in py

  • @edwinquaihoi8503
    @edwinquaihoi8503 3 หลายเดือนก่อน

    I am sorry but this is a rehash of the past, trying to abstract away the web (HTML & JavaScript) with a programming logic failed many years ago and here we are again.