I have tried to like it but I guess I am comfortable with Django's native tools. I agree, creating a template partial and passing it context using an include is not only tedious but a little hard to maintain. This is why I just create a template_tag. Custom template tags makes it easier to reuse a "component" and they are extra because they can automatically capture the view's context. I could argue that cotton's components are in fact a little verbose than a template tag. Perhaps that could be a good thing, visualising the semantic of your component when using it, but I think that's not strong point.
Finally!
I've just finished a major project using cotton. Man is it nice. Using it with alpine and htmx really lets you go far with django.
django templates is so powerful yet so ugly, this is a breath of fresh air
I have tried to like it but I guess I am comfortable with Django's native tools. I agree, creating a template partial and passing it context using an include is not only tedious but a little hard to maintain.
This is why I just create a template_tag. Custom template tags makes it easier to reuse a "component" and they are extra because they can automatically capture the view's context.
I could argue that cotton's components are in fact a little verbose than a template tag. Perhaps that could be a good thing, visualising the semantic of your component when using it, but I think that's not strong point.
Hey Cory, what IA did you use in your video?
Cursor! With Claude 3.5 sonnet.
good