{"id":4529,"url":"https://github.com/PyHAT-stack/awesome-python-htmx","name":"awesome-python-htmx","description":"A curated list of things related to python-based web development using htmx","projects_count":66,"last_synced_at":"2026-04-11T04:01:06.261Z","repository":{"id":154434498,"uuid":"632066120","full_name":"PyHAT-stack/awesome-python-htmx","owner":"PyHAT-stack","description":"A curated list of things related to python-based web development using htmx","archived":false,"fork":false,"pushed_at":"2024-08-20T13:46:07.000Z","size":87,"stargazers_count":1310,"open_issues_count":14,"forks_count":36,"subscribers_count":33,"default_branch":"main","last_synced_at":"2026-03-13T17:03:44.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PyHAT-stack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-24T16:31:03.000Z","updated_at":"2026-03-12T17:24:01.000Z","dependencies_parsed_at":"2023-12-05T00:23:44.202Z","dependency_job_id":"b97d31da-f369-4ef9-a304-db835b519ed6","html_url":"https://github.com/PyHAT-stack/awesome-python-htmx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PyHAT-stack/awesome-python-htmx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyHAT-stack%2Fawesome-python-htmx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyHAT-stack%2Fawesome-python-htmx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyHAT-stack%2Fawesome-python-htmx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyHAT-stack%2Fawesome-python-htmx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PyHAT-stack","download_url":"https://codeload.github.com/PyHAT-stack/awesome-python-htmx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyHAT-stack%2Fawesome-python-htmx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31046731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T09:35:52.079Z","status":"ssl_error","status_checked_at":"2026-03-27T09:35:20.916Z","response_time":164,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"readme":"# PyHAT: Awesome Python htmx [![Awesome](https://awesome.re/badge.svg)](https://github.com/sindresorhus/awesome)\n\nAre you interested in the intersection of Python and [Hypermedia-Driven Applications](https://htmx.org/essays/hypermedia-driven-applications/)? Head on over to the [discussions tab](https://github.com/PyHAT-stack/awesome-python-htmx/discussions), [introduce yourself](https://github.com/PyHAT-stack/awesome-python-htmx/discussions/2), and let's [get to work](https://github.com/PyHAT-stack/awesome-python-htmx/discussions/1)!\n\n\n## What is PyHAT? 🧐 \u003ca name = \"about\"\u003e\u003c/a\u003e\n\nPyHAT is more than just a snake with a hat 🐍🤠. It stands for Python htmx ASGI Tailwind\u0026mdash;a web stack that allows you to build powerful web applications using nothing more than... drumroll... Python, htmx, and Tailwind.\n\nQuick, \u003ca href=\"#tools\"\u003etake me to the tools already\u003c/a\u003e!\n\n### Our Goal\n\nWe want to promote hypermedia driven applications. That's it. That's the goal.\n\nOkay, well, more specifically, we want to promote htmx within the Python ecosystem.\n\n### Why Should I Care?\n\nDoes any of this sound like you:\n- I want to stick with just Python and HTML/CSS, [but not sacrifice front-end functionality](https://htmx.org/essays/when-to-use-hypermedia/).\n- I don't want to have to use a [complicated front end framework](https://htmx.org/essays/a-response-to-rich-harris/).\n- I don't enjoy [agonizing over CSS class names](https://tailwindcss.com/docs/utility-first#:~:text=You%20aren%E2%80%99t%20wasting%20energy%20inventing%20class%20names.).\n- I want to maintain a consistent design without any bikeshedding.\n\nIf the above sounds like you then you are in the right place!\n\n### Maybe This Isn't For Me\n\nOne of the links above goes to [When Should You Use Hypermedia](https://htmx.org/essays/when-to-use-hypermedia/) over at htmx.org, and is a pretty great read if you want to asses if this is for you. It also expounds on the following points:\n\nHypermedia might not be a good fit:\n- …If your UI has many, dynamic interdependencies\n  - i.e., Google Maps, Google Sheets\n- ...If you require offline functionality\n- …If your UI state is updated extremely frequently\n  - i.e., Online game\n- …If your team is not on board\n\n### But Will it Work in Production?\n\nYes! [Here is a very good example](https://htmx.org/essays/a-real-world-react-to-htmx-port/) of a project a company underwent using HTMX with Django in production. You can also watch the original video from DjangoCon EU 2022, titled [From React to htmx on a real-world SaaS product: we did it, and it's awesome!](https://www.youtube.com/watch?v=3GObi93tjZI)\n\u003cdetails\u003e\n\u003csummary\u003eSome highlights from the article.\u003c/summary\u003e\n\n\u003e - The effort took about 2 months (with a 21K LOC code base, mostly JavaScript)\n\u003e - No reduction in the application’s user experience (UX)\n\u003e - They reduced the code base size by 67% (21,500 LOC to 7200 LOC)\n\u003e - They increased python code by 140% (500 LOC to 1200 LOC), a good thing if you prefer python to JS\n\u003e - They reduced their total JS dependencies by 96% (255 to 9)\n\u003e - They reduced their web build time by 88% (40 seconds to 5)\n\u003e - First load time-to-interactive was reduced by 50-60% (from 2 to 6 seconds to 1 to 2 seconds)\n\u003e - Much larger data sets were possible when using htmx, because react simply couldn’t handle the data\n\u003e - Web application memory usage was reduced by 46% (75MB to 45MB)\n\n\u003c/details\u003e\n\n## Glossary :scroll:\n\n- **Asynchronous Server Gateway Interface (ASGI)** - A standard that allows an application to talk to a server, allowing for multiple, asynchronous events per application. \u003cbr\u003e\n- **component** - A reusable custom element. Within JavaScript, it is a self-contained element with its own properties/methods that are reusable. In this context, the term is more broadly applied to any reusable elements (which may include hypermedia or other design elements). \u003cbr\u003e\n- **dependency** - Any application (library or package) that are required to run your application. \u003cbr\u003e\n- **fragments** - Refers to partial content of a an HTML template. See also: _template fragments_ \u003c/br\u003e\n- **hypermedia** - Medium of information including graphics, audio, video, text, and hyperlinks, typically represented on the web as HTML \u003cbr\u003e\n- **Hypermedia Driven Application (HDA)** - Uses declarative, HTML embedded syntax to achieve front-end interactivity, while interacting with the server in terms of hypermedia (HTML) instead of a non-hypermedia format (JSON). \u003cbr\u003e\n- **partials** - A loose term, sometimes referring to \"partial\" content that can be displayed in a template, or _partial_ content to be generated from within a template block.\u003cbr\u003e\n- **Server Side Rendering (SSR)** - Generating static HTML markup on the server before it is rendered in the browser on the front-end. \u003cbr\u003e\n- **Single Page Application (SPA)** - A web app implementation that loads a single web document, and subsequently updates content through JavaScript APIs.\u003cbr\u003e\n- **template fragments** - a relatively rare SSR template library feature that allow you to render a _fragment_ or partial bit of the content within a template, rather than the entire template.\n\n\n## Usage ✏️ \u003ca name = \"usage\"\u003e\u003c/a\u003e\n\nHtmx can be used with any backend framework. Currently, there is a lot of experimentation in the Python space, which is exciting! But that also means that there are a lot of disparate approaches.\n\nThe best advice here is to get familiar with some of the core packages (htmx, tailwind). Then feel free to check out any of the packages below.\n\n\n## Official Resources 📚\n\n-   [htmx](https://htmx.org/) - htmx gives you access to AJAX, CSS Transitions, WebSockets and Server Sent Events directly in HTML, using attributes, so you can build modern user interfaces with the simplicity and power of hypertext. Htmx has no outside dependencies outside of a vanilla JavaScript file referenced in your HTML `\u003chead\u003e` section.\n-   [tailwindcss](https://tailwindcss.com/docs/installation) - Rapidly build modern websites without ever leaving your HTML. Tailwind provides a standalone CLI tool that _does not_ require npm or any other JavaScript dependencies. (You can install it through `pip` using the [pytailwindcss](https://pypi.org/project/pytailwindcss/) library)\n\n\n## Introductory Resources 🔰\n- **[How to create a Django form (using HTMX) in 90 seconds 🐎](https://www.photondesigner.com/articles/submit-async-django-form-with-htmx)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e- A simple, short guide to start using HTMX with Django very quickly 🐎\n- **[Add instant database search with Django and HTMX 🕵️](https://www.photondesigner.com/articles/database-search-django-htmx)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e - Build an instant database search using Django and HTMX in 6 steps 🕵️\n- **[Add infinite scroll with Django and HTMX in 60 seconds ∞](https://www.photondesigner.com/articles/infinite-scroll-htmx-django)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e - Shows how to add infinite scroll to your Django app using HTMX in a simple guide ∞\n-   **[simple site](https://github.com/tataraba/simplesite)** \u003ca href=\"https://fastapi.tiangolo.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-FastAPI-a9bbcc?style=flat\u0026logo=fastapi\u0026logoColor=black\" alt=\"FastAPI\"\u003e\u003c/a\u003e - Provides thorough documentation on building a site from the ground up with FastAPI, Jinja, htmx, and Tailwind.\n-   **[Rapid Prototyping with Flask, htmx, and Tailwind CSS](https://testdriven.io/blog/flask-htmx-tailwind/)** \u003ca href=\"https://flask.palletsprojects.com/en\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Flask-a9bbcc?style=flat\u0026logo=flask\u0026logoColor=black\" alt=\"Flask\"\u003e\u003c/a\u003e - In this tutorial, you'll learn how to set up Flask with htmx and Tailwind CSS. (testdriven.io)\n- **[Django, HTMX and Alpine.js: Modern websites, JavaScript optional\n](https://www.saaspegasus.com/guides/modern-javascript-for-django-developers/htmx-alpine/)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e - Building a modern front end in Django without reaching for a full-blown JavaScript framework. Choosing the right tools for the job, and bringing them into your project.\n\n\n## Introductory Courses 🏫\n\n-   **[HTMX + Flask: Modern Python Web Apps, Hold the JavaScript Course](https://training.talkpython.fm/courses/htmx-flask-modern-python-web-apps-hold-the-javascript)** \u003ca href=\"https://flask.palletsprojects.com/en\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Flask-a9bbcc?style=flat\u0026logo=flask\u0026logoColor=black\" alt=\"Flask\"\u003e\u003c/a\u003e - htmx is one of the hottest properties 🔥 in web development today, and for good reason. This framework, along with the libraries and techniques introduced in this course, will have you writing the best Python web apps you've ever written: clean, fast, and interactive without all that frontend overhead. (TalkPython Training)\n-   **[HTMX + Django: Modern Python Web Apps, Hold the JavaScript Course](https://training.talkpython.fm/courses/htmx-django-modern-python-web-apps-hold-the-javascript)** - Similar to the course above, except with Django. (TalkPython Training)\n-   **[Bugbytes Django \u0026 HTMX](https://www.youtube.com/watch?v=Ula0c_rZ6gk\u0026list=PL-2EBeDYMIbRByZ8GXhcnQSuv2dog4JxY)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e - A phenomenal tutorial series on using Django with htmx.\n-   **[Code With Stein Django Ecommerce Website Htmx and tailwind](https://youtu.be/EoYFWkxXxXM?si=ROvMhDlOWsQ3IHzQ)** - A great tutorial on building a Django ecommerce website with htmx and tailwind.\n\n\n## Design, Theory, and Patterns 🧠\n- **[Django + htmx patterns](https://github.com/spookylukey/django-htmx-patterns)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e\u003cbr/\u003e\nA compilation of patterns for writing Django projects that use htmx, with complete example code.\n- **[htmx Essays](https://htmx.org/essays/)**\u003cbr/\u003e\nA collection of essays by Carson Gross, the creator of htmx. Some specific essays of note for those not familiar with his teachings:\n    - **[Hypermedia-Driven Applications](https://htmx.org/essays/hypermedia-driven-applications/)** - This web stack could have been called PyHDA, this essay gives a great primer on how a PyHAT application should look, architecturally.\n    - **[Locality of Behaviour (LoB)](https://htmx.org/essays/locality-of-behaviour/)** - A concept you will see referred to a lot around here. \"The behaviour of a unit of code should be as obvious as possible by looking only at that unit of code\"\n    - **[Splitting Your Data \u0026 Application APIs: Going Further](https://htmx.org/essays/splitting-your-apis/)** - A great essay (responding to a [great article](https://max.engineer/server-informed-ui)).\n    \u003e If you split your API into Data and Application APIs...you should consider changing your Application API from JSON to Hypermedia (HTML) \u0026 using a hypermedia-oriented library like htmx to reap the benefits of the hypermedia model (simplicity, reliability, flexibility, etc.)\n- **[Why We Should Stop Using JavaScript According to Douglas Crockford (Inventor of JSON)](https://youtu.be/lc5Np9OqDHU)**\u003cbr/\u003e\nA short video of Douglas Crockford explaining why we should stop using JavaScript.\n- **[3 IRL use cases for Python and HTMX](https://www.bitecode.dev/p/3-irl-use-cases-for-python-and-htmx)** - _From the author:_ There is nothing HTMX does that you couldn't do in another way. But HTMX pairs wonderfully with traditional server side frameworks and gives you clean, correct, results quite fast. You won't get candy crush bling level with it, but you will get something practical, which is regularly all what I need.\n- **[HTML First](https://html-first.com)** - HTML First is a set of principles that aims to make building web software easier, faster, more inclusive, and more maintainable by... 1) Leveraging the default capabilities of modern web browsers, 2) Leveraging the extreme simplicity of HTML's attribute syntax, 3) Leveraging the web's ViewSource affordance.\n- **[You don't need JavaScript for that](https://www.htmhell.dev/adventcalendar/2023/2/)** - It's one of the core principles of web development and it means that you should Choose the least powerful language suitable for a given purpose... On the web this means preferring HTML over CSS, and then CSS over JS.\n- **[Django HTMX Components](https://dhc.iwanalabs.com/)** - Live demos and code repository of common Django + HTMX patterns. They are designed to be copy-pasted into your project and customized to your needs.\n\n\n## Third Party Packages 📦 \u003ca name = \"tools\"\u003e\u003c/a\u003e\n\n### Demos\n\n-   **[Music Binder](https://github.com/tataraba/musicbinder)** \u003ca href=\"https://fastapi.tiangolo.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-FastAPI-a9bbcc?style=flat\u0026logo=fastapi\u0026logoColor=black\" alt=\"FastAPI\"\u003e\u003c/a\u003e - More advanced version of [Simple Site repo](https://github.com/tataraba/simplesite) showcasing features like active search and infinite scroll. You can open with a Codespace in GitHub without having to install anything locally.\n-   **[Bulldoggy: The Reminders App](https://github.com/AutomationPanda/bulldoggy-reminders-app)** \u003ca href=\"https://fastapi.tiangolo.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-FastAPI-a9bbcc?style=flat\u0026logo=fastapi\u0026logoColor=black\" alt=\"FastAPI\"\u003e\u003c/a\u003e Bulldoggy is a small demo web app for tracking reminders. Uses htmx to handle `GET`, `POST`, `PATCH` requests in a fully-functioning to-do frontend.\n-   **[Owela Club](https://github.com/adamchainz/owela-club)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e - Play the Namibian game of Owela against a terrible AI. Built using Django and htmx.\n\n### Templates\n\n- **[falco](https://github.com/tobi-de/falco)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e \u003ca href=\"https://tailwindcss.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Tailwind_CSS-a9bbcc?style=flat\u0026logo=tailwindcss\u0026logoColor=black\" alt=\"Tailwind CSS\"\u003e\u003c/a\u003e\u003cbr/\u003e\nEnhance your Django developer experience: CLI and Guides for the Modern Django Developer.\n- **[django-cotton](https://github.com/wrabit/django-cotton)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e \u003ca href=\"https://tailwindcss.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Tailwind_CSS-a9bbcc?style=flat\u0026logo=tailwindcss\u0026logoColor=black\" alt=\"Tailwind CSS\"\u003e\u003c/a\u003e\u003cbr/\u003e\nCreate highly re-usable and configurable components. (No Jinja2 needed)  \n\n### Helper Libraries\n\n\u003c!--\n STARLETTE   \u003ca href=\"https://www.starlette.io/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Starlette-a9bbcc?style=flat\u0026logo=starlette\u0026logoColor=black\" alt=\"Starlette\"\u003e\u003c/a\u003e\n FASTAPI   \u003ca href=\"https://fastapi.tiangolo.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-FastAPI-a9bbcc?style=flat\u0026logo=fastapi\u0026logoColor=black\" alt=\"FastAPI\"\u003e\u003c/a\u003e\nFLASK   \u003ca href=\"https://flask.palletsprojects.com/en\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Flask-a9bbcc?style=flat\u0026logo=flask\u0026logoColor=black\" alt=\"Flask\"\u003e\u003c/a\u003e\nJINJA   \u003ca href=\"https://palletsprojects.com/p/jinja/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Jinja2-a9bbcc?style=flat\u0026logo=jinja\u0026logoColor=black\" alt=\"Jinja2\"\u003e\u003c/a\u003e\nDJANGO   \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e\nTAILWIND   \u003ca href=\"https://tailwindcss.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Tailwind_CSS-a9bbcc?style=flat\u0026logo=tailwindcss\u0026logoColor=black\" alt=\"Tailwind CSS\"\u003e\u003c/a\u003e\n--\u003e\n- **[Jinja2 fragments](https://github.com/sponsfreixes/jinja2-fragments)** \u003ca href=\"https://fastapi.tiangolo.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-FastAPI-a9bbcc?style=flat\u0026logo=fastapi\u0026logoColor=black\" alt=\"FastAPI\"\u003e\u003c/a\u003e \u003ca href=\"https://flask.palletsprojects.com/en\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Flask-a9bbcc?style=flat\u0026logo=flask\u0026logoColor=black\" alt=\"Flask\"\u003e\u003c/a\u003e \u003ca href=\"https://litestar.dev/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Litestar-a9bbcc?style=flat\u0026logoColor=black\" alt=\"Litestar\"\u003e\u003c/a\u003e \u003ca href=\"https://palletsprojects.com/p/jinja/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Jinja2-a9bbcc?style=flat\u0026logo=jinja\u0026logoColor=black\" alt=\"Jinja2\"\u003e\u003c/a\u003e\u003cbr/\u003e\nAllows rendering individual blocks from Jinja2 templates. This library was created to enable the pattern of [template fragments](https://htmx.org/essays/template-fragments/) with Jinja2. Extremely helpful when using HTMX to enable [Locality of Behavior](https://htmx.org/essays/locality-of-behaviour/)\n- **[Jinja Partials](https://github.com/mikeckennedy/jinja_partials)** \u003ca href=\"https://flask.palletsprojects.com/en\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Flask-a9bbcc?style=flat\u0026logo=flask\u0026logoColor=black\" alt=\"Flask\"\u003e\u003c/a\u003e \u003ca href=\"https://palletsprojects.com/p/jinja/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Jinja2-a9bbcc?style=flat\u0026logo=jinja\u0026logoColor=black\" alt=\"Jinja2\"\u003e\u003c/a\u003e\u003cbr/\u003e\nWhen building real-world web apps with Flask + Jinja2, it's easy to end up with repeated HTML fragments. Just like organizing code for reuse, it would be ideal to reuse smaller sections of HTML template code. That's what this library is all about.\n- **[Django Render Block](https://github.com/clokep/django-render-block)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e \u003cbr/\u003e\nAllows rendering individual blocks from Django templates. This library was created to enable the pattern of [template fragments](https://htmx.org/essays/template-fragments/) with Django (using Django or Jinja2 templates). Extremely helpful when using HTMX to enable [Locality of Behavior](https://htmx.org/essays/locality-of-behaviour/)\n- **[Flask-HTMX](https://github.com/edmondchuc/flask-htmx)** \u003ca href=\"https://flask.palletsprojects.com/en\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Flask-a9bbcc?style=flat\u0026logo=flask\u0026logoColor=black\" alt=\"Flask\"\u003e\u003c/a\u003e\u003cbr/\u003e\nA Flask extension to work with HTMX.\n- **[htmx-Flask](https://github.com/sponsfreixes/htmx-flask)** \u003ca href=\"https://flask.palletsprojects.com/en\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Flask-a9bbcc?style=flat\u0026logo=flask\u0026logoColor=black\" alt=\"Flask\"\u003e\u003c/a\u003e \u003cbr/\u003e\nAn extension for Flask that adds support for htmx to your application. It simplifies using htmx with Flask by enhancing the global 'request' object and providing a new 'make_response' function.\n- **[FastAPI-HTMX](https://github.com/maces/fastapi-htmx)** \u003ca href=\"https://fastapi.tiangolo.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-FastAPI-a9bbcc?style=flat\u0026logo=fastapi\u0026logoColor=black\" alt=\"FastAPI\"\u003e\u003c/a\u003e\u003cbr\u003e\nAn opinionated extension for FastAPI to speed up development of lightly interactive web applications.\n- **[FastHX](https://github.com/volfpeter/fasthx)** \u003ca href=\"https://fastapi.tiangolo.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-FastAPI-a9bbcc?style=flat\u0026logo=fastapi\u0026logoColor=black\" alt=\"FastAPI\"\u003e\u003c/a\u003e\u003cbr\u003e\nFlexible FastAPI utility for adding HTMX support to routes using the decorator syntax. It works with any templating engine or server-side rendering library and comes with built-in Jinja2 support.\n- **[asgi-htmx](https://github.com/florimondmanca/asgi-htmx)** \u003ca href=\"https://fastapi.tiangolo.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-FastAPI-a9bbcc?style=flat\u0026logo=fastapi\u0026logoColor=black\" alt=\"FastAPI\"\u003e\u003c/a\u003e\u003cbr\u003e\nHTMX integration for ASGI applications. Works with Starlette, FastAPI, Quart -- or any other web framework supporting ASGI that exposes the ASGI `scope`. Inspired by `django-htmx`.\n- **[django-htmx](https://github.com/adamchainz/django-htmx)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e \u003cbr/\u003e\nExtensions for using Django with htmx.\n- **[django-siteajax](https://github.com/idlesign/django-siteajax)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e \u003cbr/\u003e\nStreamline your server and client interaction using declarative techniques in your HTML and helpful abstractions from siteajax in your Python code. Powered by htmx.\n- **[hx-requests](https://github.com/yaakovLowenstein/hx-requests)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e \u003cbr/\u003e\nA package to simplify the usage of HTMX with Django. Easily add HTMX requests witout needing additional urls, and reduce clutter in views by offloading all responsibility to an hx_request.\n- **[django-cbv-htmx](https://github.com/mixmash11/django-cbv-htmx)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e \u003cbr/\u003e\nHelps connect Django Class-Based-Views with htmx.\n- **[Starlette_htmx](https://github.com/lllama/starlette-htmx)** \u003ca href=\"https://www.starlette.io/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Starlette-a9bbcc?style=flat\u0026logo=starlette\u0026logoColor=black\" alt=\"Starlette\"\u003e\u003c/a\u003e\u003cbr/\u003e\nA set of extensions for using htmx with Starlette, based on `django-htmx`.\n- **[django-template-partials](https://github.com/carltongibson/django-template-partials)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e \u003cbr/\u003e\nReusable named inline partials for the Django Template Language. [Has a great intro talk from DjangoCon](https://www.youtube.com/watch?v=_3oGI4RC52s)! 🎥\n\n### Frameworks\n- **[Litestar](https://litestar.dev)** \u003ca href=\"https://litestar.dev/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Litestar-a9bbcc?style=flat\u0026logoColor=black\" alt=\"Litestar\"\u003e\u003c/a\u003e \u003cbr/\u003e Litestar is a full-on ASGI web framework (think FastAPI, Sanic, Starlette, etc...) So why is it included here? With their most recent 2.0 release, the creators have included htmx support out of the box. A special `HTMXRequest` provides easier access to HX-request header objects, and an `HTMXTemplate` object that includes attributes for common htmx actions (pushing url, re_swap, re_targets, etc...)\n- **[Forge Packages](https://www.forgepackages.com/)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e \u003cbr/\u003e\nForge is a set of Django packages that work well together, but can also be used independently. These include some htmx/tailwind specific packages highlighted below. Note that these are opinionated approaches, but they provide a robust set of features to enhance your developer experience.\n    -   **[forge-htmx](https://www.forgepackages.com/docs/forge-htmx/)** -  The forge-htmx Django package adds a couple of unique features for working with HTMX. One is template fragments and the other is view actions.\n    -   **[forge-tailwind](https://www.forgepackages.com/docs/forge-tailwind/)** \u003ca href=\"https://tailwindcss.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Tailwind_CSS-a9bbcc?style=flat\u0026logo=tailwindcss\u0026logoColor=black\" alt=\"Tailwind CSS\"\u003e\u003c/a\u003e - Use Tailwind CSS with Django without requiring JavaScript or npm.\n- **[django_htmx_ui](https://github.com/nikalexis/django_htmx_ui)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e \u003ca href=\"https://palletsprojects.com/p/jinja/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Jinja2-a9bbcc?style=flat\u0026logo=jinja\u0026logoColor=black\" alt=\"Jinja2\"\u003e\u003c/a\u003e\u003cbr/\u003e\nA django app that combines and helps leverage the full-stack django framework, the frontend htmx framework, the django-htmx library, and the jinja template engine. It provides extended django Views with htmx build-in functionality, CRUD Views for django models, extra Mixins to use with your Views to make life easier, a ready-to-use jinja environment, Middlewares for automations, and extra utils and decorators for common use cases.\n- **[Ludic](https://github.com/paveldedik/ludic)** \u003ca href=\"https://www.starlette.io/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Starlette-a9bbcc?style=flat\u0026logo=starlette\u0026logoColor=black\" alt=\"Starlette\"\u003e\u003c/a\u003e\u003cbr/\u003e\nLudic is a lightweight ASGI web framework that allows the building of dynamic HTML pages using pure Python. It is based on Starlette and offers seamless HTMX integration, a component-based approach, and intuitive f-string templating for a smooth and powerful development experience.\n\n### Components\n\n- **[Django Dashboards](https://github.com/wildfish/django-dashboards)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e \u003cbr/\u003e\nTools to help you build data dashboards in Django.\n- **[django-htmx-autocomplete](https://github.com/PHACDataHub/django-htmx-autocomplete)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e \u003cbr/\u003e\nA client-side autocomplete component powered by htmx featuring multiselect, search and is completely extensible.\n\n### Tools \u003ca name = \"tools\"\u003e\u003c/a\u003e\n\n- **[django-tailwind-cli](https://oliverandrich.github.io/django-tailwind-cli/)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e \u003ca href=\"https://tailwindcss.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Tailwind_CSS-a9bbcc?style=flat\u0026logo=tailwindcss\u0026logoColor=black\" alt=\"Tailwind CSS\"\u003e\u003c/a\u003e\u003cbr/\u003e\nAn integration of Tailwind CSS for Django that is based on the precompiled versions of the Tailwind CSS CLI (No JS required!)\n- **[pytailwindcss](https://github.com/timonweb/pytailwindcss)** \u003ca href=\"https://tailwindcss.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Tailwind_CSS-a9bbcc?style=flat\u0026logo=tailwindcss\u0026logoColor=black\" alt=\"Tailwind CSS\"\u003e\u003c/a\u003e\u003cbr/\u003e\nTailwind CSS is notoriously dependent on _Node.js_. If you're a Python developer, this dependency may not be welcome in your team, your Docker container, or your inner circle. Giving up _Node.js_ means you won't be able to install plugins or additional dependencies for your Tailwind CSS setup. At the same time, that might not be a dealbreaker. You can still customize Tailwind CSS via the tailwind.config.js file.\n- **[HTML Form to Dict](https://github.com/guettli/html_form_to_dict)**\u003cbr/\u003e\nDo simple end-to-end testing of form handling without a real browser (like selenium/puppeteer/playwright). Supports the \"action\" and \"method\" attributes of forms and additionaly the htmx attributes hx-get, hx-post.\n\n## Projects Using PyHAT (or similar) 🏗️\n\n- **[Django Requests Tracker](https://github.com/bensi94/Django-Requests-Tracker)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e\u003cbr/\u003e\nA Django development tool which collects and displays information on requests, responses, SQL queries, headers, Django settings and more. The Front-end uses HTMX.\n- **[IDP-Z3](https://gitlab.com/krr/IDP-Z3)** \u003ca href=\"https://flask.palletsprojects.com/en\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Flask-a9bbcc?style=flat\u0026logo=flask\u0026logoColor=black\" alt=\"Flask\"\u003e\u003c/a\u003e\u003cbr/\u003e\nA software collection implementing the Knowledge Base paradigm using the FO(.) language. Uses htmx for the front end.\n- **[JupySpace](https://github.com/davidbrochart/jupyspace)** \u003ca href=\"https://fastapi.tiangolo.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-FastAPI-a9bbcc?style=flat\u0026logo=fastapi\u0026logoColor=black\" alt=\"FastAPI\"\u003e\u003c/a\u003e\u003cbr/\u003e\nA web server and client to manage conda-forge environments from the browser and access them through JupyterLab. Uses htmx on the front-end.\n- **[Harfang](https://github.com/sqwxl/harfang)** \u003ca href=\"https://docs.djangoproject.com/en/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Django-a9bbcc?style=flat\u0026logo=django\u0026logoColor=black\" alt=\"Django\"\u003e\u003c/a\u003e\u003cbr/\u003e\nA social content posting and discussion site with a focus on simplicity and accessibility. Inspired by Hacker News and Reddit. Built with Django, HTMX, Alpine.js and Tailwind CSS\n\n## Further Reading 📖\n\n- [Awesome Htmx](https://github.com/rajasegar/awesome-htmx)\n- [Maximizing Productivity: PyCharm and htmx Integration ](https://oluwatobi.dev/blog/maximizing-productivity-pycharm-and-htmx-integration/)\n- [unsuck.js](https://unsuckjs.com/)\n","created_at":"2024-01-06T20:24:58.007Z","updated_at":"2026-04-11T04:01:06.261Z","primary_language":null,"list_of_lists":false,"displayable":true,"categories":["Official Resources 📚","Introductory Resources 🔰","What is PyHAT? 🧐 \u003ca name = \"about\"\u003e\u003c/a\u003e","Introductory Courses 🏫","Design, Theory, and Patterns 🧠","Third Party Packages 📦 \u003ca name = \"tools\"\u003e\u003c/a\u003e","Further Reading 📖","Projects Using PyHAT (or similar) 🏗️"],"sub_categories":["But Will it Work in Production?","Maybe This Isn't For Me","Why Should I Care?","Helper Libraries","Frameworks","Tools \u003ca name = \"tools\"\u003e\u003c/a\u003e","Templates","Demos","Components"],"projects_url":"https://awesome.ecosyste.ms/api/v1/lists/pyhat-stack%2Fawesome-python-htmx/projects"}