Building a fullstack app with Flask and HTMx

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • shoelace-css

    A collection of professionally designed, every day UI components built on Web standards. SHOELACE IS BECOMING WEB AWESOME. WE ARE LIVE ON KICKSTARTER! 👇👇👇

  • I've been wanting to do this switch too and have the same concern. One option worth investigating is Shoelace - https://shoelace.style/, a library of nice looking web components that you can just add to your page without setting up a whole build pipeline.

  • flask-unchained

    The quickest and easiest way to build large web apps and APIs with Flask

  • I had the same pain points with Flask, so I built Flask Unchained to integrate many of the best extensions (IMO) to all work together out of the box in a reusable way:

    https://github.com/briancappello/flask-unchained

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • htmx-python-course

    Student details, source code, and more for our HTMX + Flask: Modern Python Web Apps, Hold the JavaScript course.

  • Recently saw Michael Kennedy's presentation at Python Web Conference where he talks about this. He also has a course on using Flask + HTMX. Even if you don't take the course, you do have access to the github repo for that course.

    https://github.com/talkpython/htmx-python-course

    He wrote a small library extending Jinja that does what you're referencing here, I believe. It's a little different than Jinja macros and include (you can reference the github issues for a discussion on that).

    https://github.com/mikeckennedy/jinja_partials

    Maybe that's what you're looking for?

  • jinja_partials

    Simple reuse of partial HTML page templates in the Jinja template language for Python web frameworks. #pypackage

  • Recently saw Michael Kennedy's presentation at Python Web Conference where he talks about this. He also has a course on using Flask + HTMX. Even if you don't take the course, you do have access to the github repo for that course.

    https://github.com/talkpython/htmx-python-course

    He wrote a small library extending Jinja that does what you're referencing here, I believe. It's a little different than Jinja macros and include (you can reference the github issues for a discussion on that).

    https://github.com/mikeckennedy/jinja_partials

    Maybe that's what you're looking for?

  • django-htmx

    Extensions for using Django with htmx.

  • If you use django-htmx, it's pretty simple to get the "this HTTP request came from HTMX" flag and branch accordingly in your view. The docs give a simple example of the logic here:

    https://django-htmx.readthedocs.io/en/latest/middleware.html...

    The examples give a fleshed-out version: https://github.com/adamchainz/django-htmx/blob/main/example/...

    Though that's very slightly different than how I described it above, but it's basically the same idea; in this case you commonize the `main` block between the two contexts.

  • Alpine.js

    A rugged, minimal framework for composing JavaScript behavior in your markup.

  • I was going by Github language stats indicating 90% HTML / 10% JS https://github.com/alpinejs/alpine

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts