Reputation: 61
I have created a sign in page for my blog, using bootstrap and django. I recently imported crispy forms and when I try and go to the page I get the following error: TemplateDoesNotExist at /register/
. However all my redirects and URLs are setup correctly.
On the Django debug it says that the error is in my base HTML file, under the head section where I imported bootstrap CSS. I can provide any code necessary. It says this on my server: django.template.exceptions.TemplateDoesNotExist: bootsrap4.4.1/uni_form.html
.
Upvotes: 3
Views: 10545
Reputation: 11
solution:
install crispy-bootstrap4 using the command
pip install crispy-bootstrap4
and then include
crispy_bootstrap4
in the installed apps in settings.py
Upvotes: 1
Reputation: 11
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
Upvotes: 1
Reputation: 41
install this version of django-crispy-forms "django-crispy-forms==1.14.0" and your problems will be solved.
Upvotes: 4
Reputation: 11
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.
Upvotes: 1
Reputation: 1306
set CRISPY_TEMPLATE_PACK = 'bootstrap4'
. Looks like you have it currently set to the full version number.
Upvotes: 2