2
In your TEMPLATES
setting, try changing your DIRS
setting to:
'DIRS': [os.path.join(BASE_DIR, 'templates')],
This is the usual approach, I cannot see any reason to use MAIN_DIR
as you currently do.
Keep the template as
template_name = "base/index.html"
0
I had this issue because I was using camelcase in my HTML template name but calling it with small cases. Changed template name to small case and it worked.
- [Answered ]-Django doesn't use pyodbc as python does
- [Answered ]-Django: how to add a select field in the forms.py with materializecss
- [Answered ]-FormSet saves the data of only one form
0
I also had this problem. The problem was I had:
'DIRS': [os.path.join(BASE_DIR, 'templates')],
in my settings.py instead of:
'DIRS': [os.path.join(BASE_DIR, 'Templates')],
The templates directory had a capital T, but I typed it with a lowercase t in settings.py.
- [Answered ]-Django uploading a file from a form fails to validate
- [Answered ]-Django context processors and URL arguments
- [Answered ]-Django channels and docker-compose error
- [Answered ]-Creating file from Django <InMemoryUploadedFile>
- [Answered ]-Django images not loading even after using –insecure
0
I had similar problem with space at end of file names – e.g. in a template
{% include 'myapp/components/breadcrumb.html ' %}
# SPACE HERE ^
Works just fine when developing on Windows <sigh>, fails on Linux.
- [Answered ]-Leave only one active connection per user
- [Answered ]-How to define user and group being unique together in django
Source:stackexchange.com