[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.

πŸ‘€ha-neul

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

πŸ‘€doadoadoa

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

πŸ‘€David Smith

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.

πŸ‘€volfcan

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"

πŸ‘€LabyKreative

Leave a comment