Django 1.8 で、 TEMPLATE_DEBUG 、 TEMPLATE_DIRS が 非推奨に なった
Django 1.8 で、
1.8 以前の
TEMPLATE_DEBUG = True
と記載していました。
python3 manage.py check
を実行すると、
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DEBUG.
もう廃止されたと
修正方法
じゃあ、
TEMPLATE_DEBUG deprecated — Python Anti-Patterns documentation
TEMPLATESの'debug': True,
を
同じ
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', ], 'debug': True, #コレを指定する }, }, ]
以上です。
コメント