1π
I had the same problem saying template does not exist and I solved it by changing the URL pattern in my views.py where previously I had mentioned just date.html, later I edited with blog/date.html. Hope it might help you.
2π
I solved it by adding forward slash "/" after βtemplatesβ:
'DIRS': [BASE_DIR / 'templates/'],
- [Django]-Return object when aggregating grouped fields in Django
- [Django]-Django Formset Missing Management Form Data
- [Django]-Django β new field: How to set default callable for existing objects
- [Django]-Doubled POST requests instead of single
- [Django]-Keep User and Group in same section in Django admin panel
1π
I assume 'INSTALLED_APP'
is a typo and it really says 'INSTALLED_APPS'
in your settings. Anyway, you need to set APP_DIRS = True
for templates to be found in app/templates
folders:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(BASE_DIR, 'templates'),
],
'APP_DIRS': True, # this line is important
'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'
# ...
]
},
},
]
- [Django]-Editing without using id hidden field in form?
- [Django]-Permission for field in Wagtail Page
- [Django]-With django-filter, is there a quick way to support all possible lookups for fields?
- [Django]-ModuleNotFoundError: No module named 'win32api' right after I install channels
- [Django]-Int vs String for field choices
1π
me having the same issue,
added the app to the INSTALLED_APPS
done, because you (and me) were using the templates not in the main app so it must be registered in the settings (like referring to the urls of the app from the main urls file)
- [Django]-Django SQLite foreign key mismatch error
- [Django]-Django distinct on case sensitive entries
- [Django]-How may i install the Python Imaging Library to django environment?
- [Django]-Django log file permissions with uwsgi
- [Django]-Reflection in python
0π
Go to your setting.py and try something like:
os.path.join(BASE_DIR, "templates")
For example:
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',
],
},
},
]
- [Django]-Django modelfield, how do I get the actual value?
- [Django]-Django 1.4 Creating an Edit User Profile Account Settings View
- [Django]-Jinja β load custom template tag set
- [Django]-How to make email field required in the django user admin