[Answered ]-Django NoReverseMatch at /sitemap.xml error for static views

1👍

I finally figured the problem. I should have appended the app name to the page url name.

The main/sitemap.py would be:

from django.contrib.sitemaps import Sitemap

from django.urls import reverse

class StaticViewSitemap(Sitemap):
    changefreq = 'daily'
    priority = 0.9

    def items(self):
        return ['main:homepage','main:about','main:contact']

    def location(self, item):
        return reverse(item)

Leave a comment