xaralis / django-static-sitemaps

Tool for generating sitemaps as static files to serve them from webserver instead of your Django application.
154 stars 73 forks source link

Urls Structure incorrect for .xml.gz files? #57

Closed digitaltommy closed 6 years ago

digitaltommy commented 7 years ago

I believe the current URL patterns don't pickup the compressed xml files, altering the include urls to the following solved the problem for me (just added the last line).

from static_sitemaps.views import SitemapView

url(r'^sitemap\.xml$', SitemapView.as_view(), 
    kwargs={'section': 'sitemap'}, name='static_sitemaps_index'),
url(r'^(?P<section>sitemap-.+)\.xml$', SitemapView.as_view()),
url(r'^(?P<section>sitemap-.+)\.xml.gz$', SitemapView.as_view()),

Please let me know if I've missed something or made a mistake.

Thanks, Tom

xaralis commented 7 years ago

Yeah, that seems to do the job. Can you make it a pull request? Thx

xaralis commented 6 years ago

For the record: django-static-sitemaps are not here to serve your static files. Use django.contrib.staticfiles for that. static_sitemaps only include root sitemap.xml for your convinience, but will not replicate behavior of Django staticfiles app.