TemplateDoesNotExist error
By Justin
I see this error come up a lot so here's a few quick tips to ensure you have your template setup correctly
-
Save the template file in the right directory (& check the spelling)
-
Ensure that your settings templates look something like:TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'social_django.context_processors.backends', 'social_django.context_processors.login_redirect', ], }, }, ]
-
Ensure settings.py is saved
-
Ensure your app is within INSTALLED_APPS in settings.py especially if your app directory is something like (most of the structure is left out):project/ - settings.py yourapp/ - templates/ -yourapp/ -yourapp_detail.hmtl - modes.py
-
Restart your server
That's all I can think of now. Hope that helps!