Search code examples
pythondjangotemplatesdjango-templatesdjango-registration

TemplateDoesNotExist at /accounts/register/ Error


So I am new to Django and am currently trying to build registration into my app. I have already followed this guide. However I am running into an issue in which the application is not able to find the template somehow.

Traceback:

File "/usr/local/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner 39. response = get_response(request)

File "/usr/local/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response 217. response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response 215. response = response.render()

File "/usr/local/lib/python3.5/site-packages/django/template/response.py" in render 109. self.content = self.rendered_content

File "/usr/local/lib/python3.5/site-packages/django/template/response.py" in rendered_content 84. template = self.resolve_template(self.template_name)

File "/usr/local/lib/python3.5/site-packages/django/template/response.py" in resolve_template 66. return select_template(template, using=self.using)

File "/usr/local/lib/python3.5/site-packages/django/template/loader.py" in select_template 53. raise TemplateDoesNotExist(', '.join(template_name_list), chain=chain)

Exception Type: TemplateDoesNotExist at /accounts/register/ Exception Value: registration/registration_form.html

I have checked to make sure my URL are set and everything should be in order. I have spent the past 2 hours looking for a solution to this and nothing is working.

The things that gets me the most is that in the error I can see where it checks for the template in the exact place I have it yet I am still seeing the following next to the actual path in which this template should be.

(Source does not exist)

Please help


Solution

  • Please check that you have defined TEMPLATES_DIRS properly

    In Django 1.8 upwards:

    TEMPLATES = [
        {
            'DIRS': [
                # insert your TEMPLATE_DIRS here (absolute path)
            ],
        },
    ]