MCPcopy
hub / github.com/django/django / feed

Function feed

django/contrib/gis/views.py:5–22  ·  view source on GitHub ↗

Provided for backwards compatibility.

(request, url, feed_dict=None)

Source from the content-addressed store, hash-verified

3
4
5def feed(request, url, feed_dict=None):
6 """Provided for backwards compatibility."""
7 if not feed_dict:
8 raise Http404(_("No feeds are registered."))
9
10 slug = url.partition("/")[0]
11 try:
12 f = feed_dict[slug]
13 except KeyError:
14 raise Http404(_("Slug %r isn’t registered.") % slug)
15
16 instance = f()
17 instance.feed_url = getattr(f, "feed_url", None) or request.path
18 instance.title_template = f.title_template or ("feeds/%s_title.html" % slug)
19 instance.description_template = f.description_template or (
20 "feeds/%s_description.html" % slug
21 )
22 return instance(request)

Callers

nothing calls this directly

Calls 2

Http404Class · 0.90
fFunction · 0.85

Tested by

no test coverage detected