Re:Building a fullstack app with Flask and HTMx
by sixhobbits on Tuesday March 29, 2022 @11:20AM
(#30843767)
if you don't want fancy partial-page reloads and UI interaction, then just Flask + HTML also works.
[ Parent
| on HN ]
Re:Building a fullstack app with Flask and HTMx
by keb_ on Tuesday March 29, 2022 @12:13PM
(#30844469)
Even better: Bottle.py; single-file dependency, includes routing and a simple templating engine.
Re:Building a fullstack app with Flask and HTMx
by atoav on Tuesday March 29, 2022 @01:31PM
(#30845755)
Not sure if bottle is really "better" — it has different pros and cons compared to Flask, so whether it is better depends entirely on the usecase.
If you e.g. have a use case where your dependency-situation is one where you won't benefit from bottle being single-file (because you e.g. have a ton of other non-single file dependecies), then choosing it over the widely used Flask might not be show you any benefits at all.
Re:Building a fullstack app with Flask and HTMx
by keb_ on Tuesday March 29, 2022 @01:55PM
(#30846087)
I was responding to the request in the top comment for something simpler that can be used for weekend projects. In this case, Bottle.py is "better" in that it is more simple than Flask; not that Bottle.py as a web framework is objectively better than Flask.
For the record, I've used both, and Bottle is much faster to get started with. The docs are also much leaner.
Re:Building a fullstack app with Flask and HTMx
by dannywarner on Tuesday March 29, 2022 @11:24AM
(#30843834)
Agree. Simple Flask and HTML gets you a long way and is easy to deploy and manage.
Re:Building a fullstack app with Flask and HTMx
by jacktheturtle on Tuesday March 29, 2022 @12:29PM
(#30844718)
Might want to give this a try. Thanks for sharing!
Re:Building a fullstack app with Flask and HTMx
by dfinninger on Tuesday March 29, 2022 @01:50PM
(#30846035)
Flask will take you pretty far. I'm not sure I would build a build a business around it, but it's the easiest thing I've found for just getting some code up on the web.
This tutorial is a pretty in-depth guide that incrementally adds more features to a flask app: https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial...
By no means do you need to use everything in here, but I reference it from time to time. This is plenty:
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def index():
return "<h1>hello world<h1>"
@app.route("/foo")
def foo():
return render_template("foo.html", vars={"foo": "bar"})
if __name__ == "__main__":
app.run()