[Django]-Error when using crispy forms with Django and bootstrap

2👍

set CRISPY_TEMPLATE_PACK = 'bootstrap4'. Looks like you have it currently set to the full version number.

3👍

install this version of django-crispy-forms "django-crispy-forms==1.14.0" and your problems will be solved.

1👍

I encountered similar issue and then realized that it depends on what Bootstrap version you’ve either installed or which version CDN you’re referring to in your template. I used ‘bootstrap4’ as the CRISPY-TEMPLATE_PACK in my settings.py, but in my base.html template, i’m using Bootstrap5 CDN, therefore Django is not able to retrieve bootstrap4/uni_form.html.

So make sure your template is using the same version of Bootstrap as the one you put in your settings.py.

1👍

Regarding django-crispy-forms templates packs are now in separate package,

depending on the boostrap version you are using, You will need to pip install crispy-bootstrap4 and add crispy_bootstrap4 to your list of INSTALLED_APPS.
That will solve your issue

Leave a comment