I have set URLs as explained (see below) but failed to tell django where to find the templates.
What do I need to do to have django find the templates?
More details:
is resulted with an error:
TemplateDoesNotExist at /accounts/register/
django_registration/registration_form.html
Request Method: | GET |
---|
Request URL: | http://127.0.0.1:8000/accounts/register/ |
---|
Django Version: | 2.1.3 |
---|
Exception Type: | TemplateDoesNotExist |
---|
Exception Value: | django_registration/registration_form.html |
---|
Exception Location: | C:\Program Files (x86)\Python37-32\lib\site-packages\django\template\loader.py in select_template, line 47 |
---|
Python Executable: | C:\Program Files (x86)\Python37-32\python.exe |
---|
Python Version: | 3.7.1 |
---|
I have tried to locate registration_form.html at django_reistration/reister/templates at "django_registration\registration\templates\registration" under my project.
Also tried "django-registration\registration\templates\registration" and several other locations but I keep getting the error message.
The problem could be the template location or a missing setting,...
- I added no app to the "INSTALLED_APPS" at setting.py
- my template is:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
# changed at tutor7
# 'DIRS': [],
'DIRS': [os.path.join(BASE_DIR, 'templates')],
# DIRS is a list of filesystem directories to check when loading Django templates; it’s a search path
'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',
],
},
},
]
from django.conf.urls import include, url
urlpatterns = [
# Other URL patterns ...
url(r'^accounts/', include('django_registration.backends.activation.urls')),
url(r'^accounts/', include('django.contrib.auth.urls')),
# More URL patterns ...