With Django 4, is Django crispy forms still needed?

I remember listening to a DjangoChat podcast in Django 4 and there was some mention that maybe with some of the new features in Django 4 that Django crispy forms may no longer be necessary? As someone who’s always looking to cut dependencies where possible, was wondering if anyone could shed some light on this?

PS: Major kudos to Carlton and Vincent for the amazing djangochat podcast. Thank you!

1 Like

I believe the feature they’re talking about there is Template based form rendering.

My impression of what they said is that there are some aspects of Crispy forms that will be able to be handled by the new form templates.

I haven’t played with them yet, so I have no direct experience to say. However, my gut reaction is that there are still some features of Crispy where using Crispy is going to be easier than trying to do it in a form template.

But I’d really like to see @carltongibson’s or @wsvincent’s take on this…

@smithdc1 might be able to provide proper context here, too. 4.0 has a number of templated based form renderings but django-crispy-forms covers much more than that, including built-in support for Bootstrap among other things, so I think both will be needed going forward. But I’ll defer to @carltongibson and @smithdc1 on what the current best practice is on the matter.

The dynamic form layouts aren’t available in Django. But maybe the template packs could be converted to use the inbuilt rendering.

TBH sitting down and thinking through the best way forward (what to deprecate, what to keep, how to guide users) is still on long-list.

In the short run nothing changes: crispy keeps working, maybe for some simple cases you don’t need it. But it’s the medium term that more interesting, and unknown, and exciting. :stuck_out_tongue_winking_eye: