setting.py 中配置
1 import sys 2 3 TEMPLATES = [ 4 { 5 ‘BACKEND‘: ‘django.template.backends.django.DjangoTemplates‘, 6 ‘DIRS‘: [os.path.join(BASE_DIR, ‘templates‘)], # 拼接路径 7 ‘APP_DIRS‘: True, 8 ‘OPTIONS‘: { 9 ‘context_processors‘: [ 10 ‘django.template.context_processors.debug‘, 11 ‘django.template.context_processors.request‘, 12 ‘django.contrib.auth.context_processors.auth‘, 13 ‘django.contrib.messages.context_processors.messages‘, 14 15 ], 16 }, 17 }, 18 ]
原文地址:https://www.cnblogs.com/kogmaw/p/12443967.html
时间: 2024-11-04 22:12:47