#27307: Truble with Creating a sitemap index
----------------------------------+---------------------
Reporter: Oleksandr | Owner: nobody
Type: Bug | Status: new
Component: contrib.sitemaps | Version: 1.10
Severity: Normal | Keywords: sitemap
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+---------------------
I did as documentation example
https://docs.djangoproject.com/en/1.10/ref/contrib/sitemaps/#creating-a
-sitemap-index
{{{
from django.contrib.sitemaps import views as sm_views
class PagesSitemap(Sitemap):
changefreq = "monthly"
i18n=True
def __init__(self, language):
self.language = language
def items(self):
return Pages.objects.filter(is_show=True)
sitemaps = {}
for language in settings.LANGUAGES:
sitemaps['pages-%s' % language[0]] = PagesSitemap(language[0])
urlpatterns += [
url(r'^sitemap.xml$', sm_views.index, {'sitemaps': sitemaps}),
url(r'^sitemap-(?P<section>.+)\.xml$', sm_views.sitemap, {'sitemaps':
sitemaps}),
]
}}}
and get error
{{{
NoReverseMatch at /sitemap.xml
Reverse for 'django.contrib.sitemaps.views.sitemap' with arguments '()'
and keyword arguments '{'section': 'pages-en'}' not found. 0 pattern(s)
tried: []
Request Method: GET
Request URL: http://127.0.0.1:8101/sitemap.xml
Django Version: 1.10.2
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'django.contrib.sitemaps.views.sitemap' with arguments '()'
and keyword arguments '{'section': 'pages-en'}' not found. 0 pattern(s)
tried: []
Exception Location: .venv/local/lib/python2.7/site-
packages/django/urls/resolvers.py in _reverse_with_prefix, line 392
Python Executable: .venv/bin/python
Python Version: 2.7.9
}}}
before update to 1.10.x - it's worked well with Django = 1.6.x to 1.9.x
truble only with 1.10.x
--
Ticket URL: <https://code.djangoproject.com/ticket/27307>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/054.73500d991d096a3efccc7ad0aeaa9d85%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.