You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
from django . http import Http404
from django . utils . translation import gettext as _
def feed ( request , url , feed_dict = None ) :
""" Provided for backwards compatibility. """
if not feed_dict :
raise Http404 ( _ ( " No feeds are registered. " ) )
slug = url . partition ( ' / ' ) [ 0 ]
try :
f = feed_dict [ slug ]
except KeyError :
raise Http404 ( _ ( ' Slug %r isn’ t registered. ' ) % slug )
instance = f ( )
instance . feed_url = getattr ( f , ' feed_url ' , None ) or request . path
instance . title_template = f . title_template or ( ' feeds/ %s _title.html ' % slug )
instance . description_template = f . description_template or ( ' feeds/ %s _description.html ' % slug )
return instance ( request )