Django站点地图错误-TemplateDoesNotExist

Django站点地图错误-TemplateDoesNotExist,django,django-templates,sitemap,Django,Django Templates,Sitemap,django站点地图视图出现错误 TemplateDoesNotExist at /sitemap.xml sitemap_index.xml 模板加载程序可能有问题,但我不知道具体是什么 这是我的模板配置: TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')], 'OPTION

django站点地图视图出现错误

TemplateDoesNotExist at /sitemap.xml
sitemap_index.xml
模板加载程序可能有问题,但我不知道具体是什么

这是我的模板配置:

TEMPLATES = [
{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [os.path.join(BASE_DIR, 'templates')],
    'OPTIONS': {
        'loaders': [
            'django.template.loaders.filesystem.Loader',
            'django.template.loaders.app_directories.Loader',
        ],
        'context_processors': [
            'django.template.context_processors.debug',
            'django.template.context_processors.request',
            'django.contrib.auth.context_processors.auth',
            'django.contrib.messages.context_processors.messages',
            'django.core.context_processors.media',
        ],
    },
},
]


有人有什么建议吗?

请确保您有以下建议:

INSTALLED_APPS = [
    ...
    'django.contrib.sitemaps',
    ...
]

您的项目结构是什么?@dnit13项目中每个实体都有单独的应用程序。添加到已安装应用的所有应用。“项目结构”下的确切含义是什么?我猜他指的是项目和应用程序的结构,文件夹层次结构,例如sitemap.xml的位置?正如我所理解的模板位于此处:我通过在应用程序“模板”目录中添加这些模板的副本进行修复。但还是想解决这个问题。。