Sitemap in Python Django

Sitemap in Python Django

# For Sitemap
from django.views.generic import TemplateView
urlpatterns = [

    url(r'^admin/', admin.site.urls),

    #include testapp app url
    url(r'', include('testapp.urls')),

    url(r'^sitemap\.xml$', TemplateView.as_view(template_name='sitemap.xml', content_type='text/xml')),


]
**  keep the sitemap.xml file in app/templates/sitemap.xml