[Fixed]-TemplateDoesNotExist at /users/register/ bootstrap5/uni_form.html

4👍

Based on the latest crispy form doc, it seems that there is no built-in bootstrap5 for it. Are you sure you are using bootstrap5?

Currently, there are only bootstrap, bootstrap3, bootstrap4, and uni-form.

You can take a look at your file structure if you even see bootstrap5 folder.

35👍

I also ran to this problem but crispy-form is already supporting boostrap 5. In their github page was instructed as so

$ pip install django-crispy-forms

$ pip install crispy-bootstrap5

And in settings.py

INSTALLED_APPS = [
 ...,
'crispy_forms',
'crispy_bootstrap5',  # Forgetting this was probably your error
 ]

And then at the bottom of the page of settings.py

CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
CRISPY_TEMPLATE_PACK = "bootstrap5"

This worked for me solving the TemplateDoesNotExist error. No need to downgrade to bootstrap4

3👍

As you say you have installed crispy_forms and added to installed_apps in settings.py
file then next step is to use following code:
pip install crispy-bootstrap5 – in your command line

then do some changes in your settings.py file as follow:

CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"

CRISPY_TEMPLATE_PACK = "bootstrap5"

👤diff

1👍

The bootstrap 5 template pack will be a separate package. There is a very early version available on PyPI and here is the GitHub link.

https://github.com/django-crispy-forms/crispy-bootstrap5

0👍

As of django-crispy-forms 2.0 the template packs are now in separate packages.

You will need to pip install crispy-bootstrap4 and add crispy_bootstrap4 to your list of INSTALLED_APPS.

0👍

This worked for me:
$ pip install django-crispy-forms

$ pip install crispy-bootstrap5
And in settings.py

INSTALLED_APPS = [
…,
‘crispy_forms’,
‘crispy_bootstrap5’,
]

And then at the bottom of the page of settings.py

CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
CRISPY_TEMPLATE_PACK = "bootstrap5"

Leave a comment