Как изменить хост в django-robots?
Я пытаюсь добавить X-Robots-Tag Я использую эту библиотеку Django-robots и у меня все установлено, я застрял на имени хоста на sitemap показывая example.com ссылка документации https://django-robots.readthedocs.io/en/latest/#
скриншот https://i.stack.imgur.com/GWUPu.png
'''
#sitemaps.py
class StaticViewsSitemap(sitemaps.Sitemap):
priority = 1.0
changefreq = "daily"
def items(self):
return [
'home',
]
def location(self, items):
return reverse(items)
class SnippetSitemap(sitemaps.Sitemap):
priority = 1.0
changefreq = "daily"
def items(self):
return Snippet.objects.all()
#urls.py
urlpatterns = [
...
path('<slug:slug>/', views.Snippet_detail),
url(r'^robots1\.txt', include('robots.urls')),
url(r'^sitemap1.xml$', cache_page(60*60*1)(sitemap),
{'sitemaps': sitemaps}, name='cached-sitemap'),
...
]
#models.py
class Snippet(models.Model):
title = models.CharField(max_length=150)
slug = models.SlugField(blank=True, null=True)
body = models.TextField()
def save(self, *args, **kwargs):
self.slug = slugify(self.title)
super().save(*args, **kwargs)
def get_absolute_url(self):
return f'/{self.slug}/'
'''