Live data from Hacker News

FastHTML – Modern web applications in pure Python

fastht.ml

31–40 of 229 posts

Re: FastHTML – Modern web applications in pure Python

#31
post #24

First, I welcome any project that enriches a software ecosystem, and this project no doubt does just that. However, I have two points which will deter me from using this (or any python->html/js framework) in a commercial production project: 1. It silos front end development in Python world. It might be great if your entire team are and always will be Python devs, but what happens when you want dedicated from end deve…

1. These folks on such a project will otherwise need to deal with templates with Python in them. Inside out or outside in, there’s some complexity.

Linted, formatted, optionally typed Python is likely going to be more maintainable than html templates in the long run and is one of the easier langs to pick up. css/js can be linked separately.

I don’t see any limitations that would prevent one from using a template on a new page.

I recently looked into these kind of html builder libs, pioneered by dominate. “htpy” was the only one where I was impressed with the source code.

Re: FastHTML – Modern web applications in pure Python

#33
I was talking with my cofounder today about how we'd likely need to become a multilingual platform once we eventually take on more than backend applications and I'm glad to see projects like this. They give me hope that we won't have to make that jump.

I'm really excited to give this a try seeing as this should just run on our cloud with minimal to no changes given the premise.

I know of one or two other projects like this in the ecosystem, but this approach seems the most promising so far.

Also I'm not sure when Jeremy finds time to sleep given all the other exciting work from Answer.AI. and his various courses :P

I recently implemented deepspeed + qlora in a finetuning library and that was also entirely based on the fsdp implementation him and his various associates wrote.

So he really is just making great contributions all over the place.

Re: FastHTML – Modern web applications in pure Python

#36
While the design of it violates the separation of concern principle (keep data and code separate), I have to say this is most impressive, thanks for writing and sharing it.

I have always been reluctant to accept any boilerplate code (esp. such that one cannot fully understand) in my codebase, and this does not have ANY! All the sample code looks absolutely beautiful, so I will give this a try for my next Web app projects.

Re: FastHTML – Modern web applications in pure Python

#37
I'm looking at the very first example, and I'm a little confused. The function `home()` displays a list of messages, but they aren't passed into `home()`. Instead, `messages` is basically a global variable, and some other functions can append messages to it. Then I went looking at some more examples, and I see this pattern repeated. Is this how you're supposed to build webapps with this package? How does it isolate the list of messages for different users?

Re: FastHTML – Modern web applications in pure Python

#39

Oh my goodness. I like to keep things boring where possible and swore I would never stray from Django + HTMX + Django Ninja, but I am exceedingly tempted to use this in an upcoming project. Lovely architectural choices - bravo!

It's a bit of a tangent, but do you have any go-to resources for learning how to use Django-ninja with HTMX? I haven't really put a lot of time into it, but HTMX seemed difficult to use with JSON APIs on first attempt.

I'm only really familiar with Django and DRF, but if love to switch at some point.

Re: FastHTML – Modern web applications in pure Python

#40

I'm looking at the very first example, and I'm a little confused. The function `home()` displays a list of messages, but they aren't passed into `home()`. Instead, `messages` is basically a global variable, and some other functions can append messages to it. Then I went looking at some more examples, and I see this pattern repeated. Is this how you're supposed to build webapps with this package? How does it isolate t…

Which example? I see global vars in a couple of the demos. The game state for the Game of Life makes sense, since it is intended to be shared. The `messages` list in the Chatbot demo is definitely NOT how you'd build a multi-user application, that's mainly showing the styling aspect.

In general, you'd have an actual database and make it so users can only see their own data! See https://github.com/AnswerDotAI/fasthtml/blob/main/examples/a... which adds a filter to queries and DDL statements to ensure that the user can only see/edit their own todos.

Post reply on HN