[Django] #27307: Truble with Creating a sitemap index

24 views
Skip to first unread message

Django

unread,
Oct 3, 2016, 11:02:48 AM10/3/16
to django-...@googlegroups.com
#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.

Django

unread,
Oct 3, 2016, 12:05:18 PM10/3/16
to django-...@googlegroups.com
#27307: sitemap url examples missing names
-------------------------------+--------------------------------------
Reporter: Oleksandr | Owner: Tim Graham
Type: Bug | Status: assigned
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: sitemap | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Tim Graham):

* status: new => assigned
* needs_better_patch: => 0
* component: contrib.sitemaps => Documentation
* needs_tests: => 0
* owner: nobody => Tim Graham
* needs_docs: => 0
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/27307#comment:1>

Django

unread,
Oct 3, 2016, 12:07:43 PM10/3/16
to django-...@googlegroups.com
#27307: sitemap url examples missing names
-------------------------------+--------------------------------------
Reporter: Oleksandr | Owner: Tim Graham
Type: Bug | Status: assigned
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: sitemap | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Tim Graham):

* Attachment "27273.diff" added.

Django

unread,
Oct 3, 2016, 12:08:25 PM10/3/16
to django-...@googlegroups.com
#27307: sitemap url examples missing names
-------------------------------+--------------------------------------
Reporter: Oleksandr | Owner: Tim Graham
Type: Bug | Status: assigned
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: sitemap | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Tim Graham):

* has_patch: 0 => 1


Comment:

Could you confirm that changing your `url()` as done in the attached patch
fixes it?

--
Ticket URL: <https://code.djangoproject.com/ticket/27307#comment:2>

Django

unread,
Oct 3, 2016, 3:59:04 PM10/3/16
to django-...@googlegroups.com
#27307: sitemap url examples missing names
-------------------------------------+-------------------------------------
Reporter: Oleksandr | Owner: Tim
Shtalinberg | Graham

Type: Bug | Status: assigned
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: sitemap | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Oleksandr Shtalinberg):

Yes, patch fixes it . Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/27307#comment:3>

Django

unread,
Oct 3, 2016, 4:05:43 PM10/3/16
to django-...@googlegroups.com
#27307: sitemap url examples missing names
-------------------------------------+-------------------------------------
Reporter: Oleksandr | Owner: Tim
Shtalinberg | Graham
Type: Bug | Status: closed
Component: Documentation | Version: 1.10
Severity: Normal | Resolution: fixed

Keywords: sitemap | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"fe1aee6b98d2a94ecc983463938135d192ef9afc" fe1aee6]:
{{{
#!CommitTicketReference repository=""
revision="fe1aee6b98d2a94ecc983463938135d192ef9afc"
Fixed #27307 -- Added missing url names in sitemaps docs.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27307#comment:4>

Django

unread,
Oct 3, 2016, 4:06:21 PM10/3/16
to django-...@googlegroups.com
#27307: sitemap url examples missing names
-------------------------------------+-------------------------------------
Reporter: Oleksandr | Owner: Tim
Shtalinberg | Graham
Type: Bug | Status: closed
Component: Documentation | Version: 1.10
Severity: Normal | Resolution: fixed
Keywords: sitemap | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"3141b79d26ea2075c38b7b1779325f5b8b9c3baf" 3141b79]:
{{{
#!CommitTicketReference repository=""
revision="3141b79d26ea2075c38b7b1779325f5b8b9c3baf"
[1.8.x] Fixed #27307 -- Added missing url names in sitemaps docs.

Backport of fe1aee6b98d2a94ecc983463938135d192ef9afc from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27307#comment:7>

Django

unread,
Oct 3, 2016, 4:06:23 PM10/3/16
to django-...@googlegroups.com
#27307: sitemap url examples missing names
-------------------------------------+-------------------------------------
Reporter: Oleksandr | Owner: Tim
Shtalinberg | Graham
Type: Bug | Status: closed
Component: Documentation | Version: 1.10
Severity: Normal | Resolution: fixed
Keywords: sitemap | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"69a2d0c5bff7e67ec00910491a3939982f75c466" 69a2d0c]:
{{{
#!CommitTicketReference repository=""
revision="69a2d0c5bff7e67ec00910491a3939982f75c466"
[1.9.x] Fixed #27307 -- Added missing url names in sitemaps docs.

Backport of fe1aee6b98d2a94ecc983463938135d192ef9afc from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27307#comment:5>

Django

unread,
Oct 3, 2016, 4:06:23 PM10/3/16
to django-...@googlegroups.com
#27307: sitemap url examples missing names
-------------------------------------+-------------------------------------
Reporter: Oleksandr | Owner: Tim
Shtalinberg | Graham
Type: Bug | Status: closed
Component: Documentation | Version: 1.10
Severity: Normal | Resolution: fixed
Keywords: sitemap | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"67fd51a54f5c9d702c2e75dd0aa8520aeb0518ab" 67fd51a5]:
{{{
#!CommitTicketReference repository=""
revision="67fd51a54f5c9d702c2e75dd0aa8520aeb0518ab"
[1.10.x] Fixed #27307 -- Added missing url names in sitemaps docs.

Backport of fe1aee6b98d2a94ecc983463938135d192ef9afc from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27307#comment:6>

Reply all
Reply to author
Forward
0 new messages