Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
litchfield committed Jul 18, 2013
1 parent 7405636 commit d5d4895
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
##Fast, streaming sitemaps for Django
###Fast, streaming sitemaps for Django

This is a drop-in replacement for django.contrib.sitemaps.
Drop-in replacement for django.contrib.sitemaps that gives you fast, streaming sitemaps that consume minimal memory (O^1 instead of O^n) and minimal server response time on huge data sets.

Simply update your url patterns to use 'fastsitemaps' instead of 'django.contrib.sitemaps'; and whalla, you get fast, streaming sitemaps that consume bugger all memory even on huge data sets.
If you've got sitemaps with millions of urls, this is your friend.

It's not necessary, but you might also choose to add 'fastsitemaps' to your INSTALLED_APPS just to remind and inform yourself and your buddies that you're using it.
####Usage

####Example
Simply update your url patterns to use 'fastsitemaps' instead of 'django.contrib.sitemaps'

Instead of something like this --

Expand All @@ -18,6 +18,8 @@ Try this --
url(r'^sitemap\.xml$', 'fastsitemaps.views.index', {'sitemaps': sitemap_dict}),
url(r'^sitemap-(?P<section>.+)\.xml$', 'fastsitemaps.views.sitemap', {'sitemaps': sitemap_dict}),

It's not necessary, but you might also choose to add 'fastsitemaps' to your INSTALLED_APPS just to remind and inform yourself and your buddies that you're using it.

####Varying sitemaps by request/site

Another little optional and somewhat unrelated freebie that's included here is fastsitemaps.RequestSitemap, which is the same as Sitemap but gives you access to the request object, via self.request. It can be handy for sitemaps that vary based on site or host name.
Expand All @@ -33,3 +35,6 @@ You can also set settings.FASTSITEMAPS_SITE_ATTR to the name of a property on yo
(See settings.FASTSITEMAPS_SITE_ATTR attribute- default 'site', ie request.site)
This can be useful if you are running multiple "sites" in one app instance.

####Future

It'd be nice to include a simple on/off setting that causes your sitemaps to be served from disk; and a celery task and management command to trigger the pre-rendering to disk.

0 comments on commit d5d4895

Please sign in to comment.