News for hackers. Stuff that matters.
Re:Things I do every time I start a Django project by 41b696ef1113 on Thursday June 23, 2022 @11:02PM (#31857344)
As another hold-out on Jinja, what pushed you over the edge? Half of the appeal to me in Django is that if you follow the easy path, one project should look like another. Breaking conventions for a few template niceties has not seemed worth it (although, I am not a front end guy, and survive on very barebones presentation).
Re:Things I do every time I start a Django project by nojs on Thursday June 23, 2022 @11:11PM (#31857383)
> what pushed you over the edge?

Using Tailwind without a frontend js framework. I needed a way to create lightweight “components” ala React but on the backend, because otherwise you’re either copy pasting classes like mad or (ab)using tailwind’s @apply.

Re:Things I do every time I start a Django project by spapas82 on Friday June 24, 2022 @05:28AM (#31859483)
I had used this project for creating components https://github.com/EmilStenstrom/django-components/

Also, for simpler cases I include partial templates.

Re:Things I do every time I start a Django project by jereze on Friday June 24, 2022 @04:10AM (#31858970)
How do you create your components in Jinja2? Using the include tag?
Re:Things I do every time I start a Django project by nojs on Friday June 24, 2022 @07:45AM (#31860352)
I am using {% macro %}
Re:Things I do every time I start a Django project by drcongo on Friday June 24, 2022 @09:48AM (#31861761)
I've been gradually removing all use of Jinja macros from our projects as they make debugging so much more painful. Everything now goes in template globals, which lets you debug them the same as anything else, gives far clearer stack traces and lets you do clever things with caching.