第一步:配置 1.在工程中创建模板目录templates. 2.在settings.py配置文件中修改TEMPLATES配置项的DIRS值:TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')], # 此处修改 'APP_DIRS': True, 'OPTIONS': { 'context_processo…