我遇到的一个问题是,我怀疑Google正确查看sitemaps.xml
的内容类型不正确-它突出了以下问题:
Your Sitemap appears to be an HTML page. Please use a supported sitemap format instead.
所以,我想我需要改变内容类型。我看到了一些奇怪的方法,一切都使用lambdas和HttpResponse解决方案。对于如下的url,有没有一种简单的方法可以将内容类型更改为'text/plain'
或'text/xml'
?你知道吗
以下操作无效:
url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps, content_type='plain/xml'}, name='sitemap')
sitemaps = {'views': ViewSitemap}
其中ViewSiteMap是返回静态URL的类。什么是更聪明的方法?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐