#10235: contrib.sitemaps doesn't support RequestSite
-----------------------------------+----------------------------------------
Reporter: arthurk | Owner: nobody
Status: new | Milestone:
Component: Contrib apps | Version: 1.0
Resolution: | Keywords: sitemap
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-----------------------------------+----------------------------------------
Comment (by arthurk):
I've revised the patch and added a helper function like you suggested.
Having the request as an attribute on the class would be cleaner than
setting site.request in the view but not possible as Sitemaps can be
callables as well as objects:
{{{
sitemaps = {
'foobar': FoobarSitemap,
'blog': GenericSitemap(info_dict, priority=0.6),
}
}}}
FlatPageSitemap doesn't support RequestSite because the flatpages app
requires the sites framework and RequestSite isn't a subclass of
models.Model so flatpage_set will not be available.
The ping_google function also doesn't use RequestSite because it's
impossible to get a request from the CLI. The only possibility I can think
of is to specify the full sitemap url as an argument to the ping_google
command e.g. "./manage.py ping_google http://foobar.com/sitemap.xml" but
according to the docs this argument is already reserved for the absolute
sitemap url (e.g. "/sitemap.xml")
http://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/#pinging-google-
via-manage-py
--
Ticket URL: <http://code.djangoproject.com/ticket/10235#comment:3>
Django <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---