I would like to create a Site specific Sitemap using Django Sitemaps.
My idea was to do something like this :
def items(self):
current_site = Site.objects.get_current(self.request)
return current_site.pages.filter(draft=False)
But I have two issues :
self.requestis not defined, is there a way to get the realcurrent_siteinside the Sitemap ?- The items URL is not right, it should starts with the right
current_site
I guess, I have to pass directly the right queryset to my Sitemap, but how can I do that ?
Thanks,
Rémy