About Ignoring Default Static Files in Crispy Forms

By default {% crispy form %} includes the CSS and Javascript files coming from the Media classes of its form fields.

To ignore them and use your custom styling and scripts in the templates, you need to modify the helper's include_media parameter as follows:

1
2
3
4
form.helper = FormHelper()
form.helper.form_action = request.path
form.helper.form_method = "POST"
form.helper.include_media = False

Tips and Tricks Development Django 5.x Django 4.2 Django 3.2 django-crispy-forms