summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-07-12 05:29:32 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-07-12 05:29:32 +0000
commit090aa5210ebd5ce3c79db95d3f04c95ed346f42a (patch)
tree8811537abe6486c7a09e494aa6debcadfedbea14 /docs
parentdcd5750d7ac6692428e431010772f1941406d576 (diff)
Improved syndication feed framework to use RequestSite if the sites framework is not installed -- i.e., the sites framework is no longer required to use the syndication feed framework. This is backwards incompatible if anybody has subclassed Feed and overridden __init__(), because the second parameter is now expected to be an HttpRequest object instead of request.path
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5654 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/syndication_feeds.txt17
1 files changed, 15 insertions, 2 deletions
diff --git a/docs/syndication_feeds.txt b/docs/syndication_feeds.txt
index fe70f2ae7d..393572f3e2 100644
--- a/docs/syndication_feeds.txt
+++ b/docs/syndication_feeds.txt
@@ -31,6 +31,12 @@ To create a feed, just write a ``Feed`` class and point to it in your URLconf_.
Initialization
--------------
+If you're not using the latest Django development version, you'll need to make
+sure Django's sites framework is installed -- including its database table.
+(See the `sites framework documentation`_ for more information.) This has
+changed in the Django development version; the syndication feed framework no
+longer requires the sites framework.
+
To activate syndication feeds on your Django site, add this line to your
URLconf_::
@@ -72,6 +78,7 @@ The above example registers two feeds:
Once that's set up, you just need to define the ``Feed`` classes themselves.
+.. _sites framework documentation: ../sites/
.. _URLconf: ../url_dispatch/
.. _settings file: ../settings/
@@ -131,9 +138,14 @@ put into those elements.
* ``{{ obj }}`` -- The current object (one of whichever objects you
returned in ``items()``).
- * ``{{ site }}`` -- A ``django.models.core.sites.Site`` object
+ * ``{{ site }}`` -- A ``django.contrib.sites.models.Site`` object
representing the current site. This is useful for
- ``{{ site.domain }}`` or ``{{ site.name }}``.
+ ``{{ site.domain }}`` or ``{{ site.name }}``. Note that if you're
+ using the latest Django development version and do *not* have the
+ Django sites framework installed, this will be set to a
+ ``django.contrib.sites.models.RequestSite`` object. See the
+ `RequestSite section of the sites framework documentation`_ for
+ more.
If you don't create a template for either the title or description, the
framework will use the template ``"{{ obj }}"`` by default -- that is,
@@ -164,6 +176,7 @@ put into those elements.
.. _chicagocrime.org: http://www.chicagocrime.org/
.. _object-relational mapper: ../db-api/
.. _Django templates: ../templates/
+.. _RequestSite section of the sites framework documentation: ../sites/#requestsite-objects
A complex example
-----------------