django.template.exceptions.TemplateDoesNotExist:home.html

use*_*939 1 python django templates

django 项目运行良好!主页和其他页面渲染没有问题。我创建产品应用程序/组件页面并意外命名为“模板”模板,因此我将模板重命名为“模板”,当我开始时遇到问题。

我运行终端命令:

  • python 管理.py makemigrations
  • python 管理.py 迁移
  • 蟒蛇收集静态

什么都不起作用!

我收到一条错误消息:

django.template.exceptions.TemplateDoesNotExist:home.html

Mat*_*ser 6

尝试将“settings.py”中当前的“TEMPLATES”变量替换为:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')],
        'APP_DIRS': True,
    },
]
Run Code Online (Sandbox Code Playgroud)