88
Set debug
in OPTIONS
dictionary of your templates settings.
DEBUG = True
TEMPLATES = [
{
...
'OPTIONS': {
'debug': DEBUG,
},
},
]
Then remove this line from your settings to stop the warnings
TEMPLATE_DEBUG = DEBUG
See the Django docs for detailed instructions how to update your template settings.
15
remove APP_DIRS and add the loaders inside the templates.
example:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')]
,
'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',
],
'loaders': [
'django_jinja.loaders.AppLoader',
'django_jinja.loaders.FileSystemLoader',
]
},
},
]
- [Django]-Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed. (Django 1.8 and OSX ElCapitan)
- [Django]-How to automatically destroy django test database
- [Django]-How do I use Django groups and permissions?
14
From settings.py remove all this:
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'templates'),
)
Then add ‘templates’ here:
TEMPLATES = [
{
...
'DIRS': [here],
...
],
},
},
]
- [Django]-How can I get MINIO access and secret key?
- [Django]-Django ALLOWED_HOSTS IPs range
- [Django]-Django.contrib.auth.logout in Django
8
This is the best solution:
Change this line to:
TEMPLATES[0]['OPTIONS']['debug'] = True
which should fix the warning.
I have found it here.
- [Django]-Custom form validation
- [Django]-How to add a new field to a model with new Django migrations?
- [Django]-Django 1.7 upgrade error: AppRegistryNotReady: Apps aren't loaded yet
1
In my setting.py
in django
, there is not this script :
TEMPLATE_DEBUG = DEBUG
and
'debug': DEBUG,
'DEBUG': DEBUG,
'TEMPLATE_DEBUG': DEBUG
Maybe you can try to remove them and run it again.
- [Django]-Error loading MySQLdb Module 'Did you install mysqlclient or MySQL-python?'
- [Django]-How to show a PDF file in a Django view?
- [Django]-Django template includes slow?
Source:stackexchange.com