clokep / django-render-block

Render the content of a specific block tag from a Django template.
ISC License
241 stars 23 forks source link

I am working on a Awesome-Python-HTMX, seeking your feedback #43

Closed benjamin-kirkbride closed 1 year ago

benjamin-kirkbride commented 1 year ago

A few of us at PyCon this year got together and brainstormed a new Web Stack that we are calling PyHAT (Python, htmx, ASGI, TailwindCSS). The first thing we set out to do is create awesome-python-htmx; a collection of active tools/libraries/projects in that space. Your project seems like an obvious thing to include, as template fragmenting is extremely helpful in creating hypermedia driven applications.

You don't mention htmx anywhere, did you make this with htmx (or a similar project) in mind?

clokep commented 1 year ago

You don't mention htmx anywhere, did you make this with htmx (or a similar project) in mind?

No, I have not used HTMX. I was using this to template emails, mostly.

clokep commented 1 year ago

(I'm going to close this since it is kind of a meta question and there's no action to take in this repo. Feel free to keep the conversation going though.)

benjamin-kirkbride commented 1 year ago

Understood. https://www.bugbytes.io/posts/template-fragments-with-django-and-htmx/ pointed me in this direction. Thanks for the project!

clokep commented 1 year ago

Understood. bugbytes.io/posts/template-fragments-with-django-and-htmx pointed me in this direction. Thanks for the project!

Thanks for the link! I hadn't seen it. 👍 I can definitely see how it could be used with HTMX though!

benjamin-kirkbride commented 1 year ago

https://github.com/spookylukey/django-htmx-patterns/ uses it too!

clokep commented 1 year ago

Reading through https://htmx.org/essays/template-fragments/ and https://htmx.org/essays/locality-of-behaviour/ (from https://github.com/PyHAT-stack/awesome-python-htmx) it seems that this was the same problem I was facing though: I wanted a way to keep a subject, text, and HTML parts of an email together in the same template file. See https://github.com/vintasoftware/django-templated-email

benjamin-kirkbride commented 1 year ago

Yes, it absolutely is! Email is arguably a form of hypertext after all, so much of the same principles would apply.