#27307 closed Bug (fixed)
sitemap url examples missing names
Reported by: | Oleksandr Shtalinberg | Owned by: | Tim Graham |
---|---|---|---|
Component: | Documentation | Version: | 1.10 |
Severity: | Normal | Keywords: | sitemap |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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
Attachments (1)
Change History (8)
comment:1 by , 8 years ago
Component: | contrib.sitemaps → Documentation |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Summary: | Truble with Creating a sitemap index → sitemap url examples missing names |
Triage Stage: | Unreviewed → Accepted |
by , 8 years ago
Attachment: | 27273.diff added |
---|
comment:2 by , 8 years ago
Has patch: | set |
---|
Note:
See TracTickets
for help on using tickets.
Could you confirm that changing your
url()
as done in the attached patch fixes it?