From d5d4895a543b62850e9f37d9b22e89f1f1d3dd3e Mon Sep 17 00:00:00 2001 From: Simon Litchfield Date: Thu, 18 Jul 2013 11:55:42 +1000 Subject: [PATCH] Updated docs --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 730e394..b95aeeb 100644 --- a/README.md +++ b/README.md @@ -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 -- @@ -18,6 +18,8 @@ Try this -- url(r'^sitemap\.xml$', 'fastsitemaps.views.index', {'sitemaps': sitemap_dict}), url(r'^sitemap-(?P
.+)\.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. @@ -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. \ No newline at end of file