title: TemplateDoesNotExist at /users/register/ bootstrap5/uni_form.html
body: <p>I am building a registration form for my django project, and for styling it I am using crispy forms. But, when I run my server and go to my registration page, I see this error:</p>
  <pre><code>    Internal Server Error: /users/register/
  Traceback (most recent call last):
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\backends\django.py&quot;, line 61, in render
      return self.template.render(context)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\base.py&quot;, line 170, in render
      return self._render(context)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\base.py&quot;, line 162, in _render
      return self.nodelist.render(context)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\base.py&quot;, line 938, in render
      bit = node.render_annotated(context)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\base.py&quot;, line 905, in render_annotated
      return self.render(context)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\loader_tags.py&quot;, line 150, in render
      return compiled_parent._render(context)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\base.py&quot;, line 162, in _render
      return self.nodelist.render(context)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\base.py&quot;, line 938, in render
      bit = node.render_annotated(context)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\base.py&quot;, line 905, in render_annotated
      return self.render(context)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\loader_tags.py&quot;, line 62, in render
      result = block.nodelist.render(context)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\base.py&quot;, line 938, in render
      bit = node.render_annotated(context)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\base.py&quot;, line 905, in render_annotated
      return self.render(context)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\base.py&quot;, line 988, in render
      output = self.filter_expression.resolve(context)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\base.py&quot;, line 698, in resolve
      new_obj = func(obj, *arg_vals)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\crispy_forms\templatetags\crispy_forms_filters.py&quot;, line 60, in as_crispy_form
      template = uni_form_template(template_pack)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\crispy_forms\templatetags\crispy_forms_filters.py&quot;, line 21, in uni_form_template
      return get_template(&quot;%s/uni_form.html&quot; % template_pack)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\loader.py&quot;, line 19, in get_template
      raise TemplateDoesNotExist(template_name, chain=chain)
  django.template.exceptions.TemplateDoesNotExist: bootstrap5/uni_form.html
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\core\handlers\exception.py&quot;, line 47, in inner
      response = get_response(request)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\core\handlers\base.py&quot;, line 179, in _get_response
      response = wrapped_callback(request, *callback_args, **callback_kwargs)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\microblog_project\users\views.py&quot;, line 17, in register
      return render(request, 'users/register.html',context)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\shortcuts.py&quot;, line 19, in render
      content = loader.render_to_string(template_name, context, request, using=using)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\loader.py&quot;, line 62, in render_to_string
      return template.render(context, request)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\backends\django.py&quot;, line 63, in render
      reraise(exc, self.backend)
    File &quot;C:\Users\Dell\Desktop\Django\microblog\venv\lib\site-packages\django\template\backends\django.py&quot;, line 84, in reraise
      raise new from exc
  django.template.exceptions.TemplateDoesNotExist: bootstrap5/uni_form.html
  </code></pre>
  <p>This doesn't look like the usual <code>TemplateDoesNotExistError</code> I get. I think this is the error in my crispy form, because if I remove the crispy template tags in my form, everything works fine.</p>
  <p>Here is my register template:</p>
  <pre><code>{% extends 'base.html' %}
  {% load crispy_forms_tags %}
  
  {% block title %}Register{% endblock %}
  
  {% block content %}
  &lt;h1&gt;Sign up for a new account&lt;/h1&gt;
  &lt;hr&gt;
  &lt;form action=&quot;&quot; method=&quot;post&quot;&gt;
      {% csrf_token %}
      {{ form|crispy }}
      &lt;button type=&quot;submit&quot; class=&quot;btn btn-sm btn-primary&quot;&gt;Register&lt;/button&gt;
  &lt;/form&gt;
  &lt;p&gt;
      Already have an account?
      &lt;a href=&quot;#&quot;&gt;Log in&lt;/a&gt;
  &lt;/p&gt;
  {% endblock %}
  </code></pre>
  <p>And just in case it is required, here is my view function:</p>
  <pre><code>def register(request):
      form = RegistrationForm()
  
      if request.method == 'POST':
          form = RegistrationForm(data=request.POST)
          if form.is_valid():
              form.save()
              return HttpResponse(&quot;Successfully Registered!!!&quot;)
  
      context = {
          'form':form,
      }
      return render(request, 'users/register.html',context)
  </code></pre>
  <p>I have specefied CRISPY_TEMPLATE_PACK in my settings.py and also added crispy_forms to my INSTALLED_APPS. Where am I going wrong?</p>
  <p>EDIT:</p>
  <p>So I did a bit more research on this topic and this error is probably because crispy forms does not support bootstrap 5 yet. So, by changing the bootstrap5 to bootstrap4 in my CRISPY_TEMPLATE_PACK, the error is solved</p>