def feed(request, url, feed_dict=None):
 from django.contrib.syndication.feeds import Feed as LegacyFeed
 import warnings
 warnings.warn('The syndication feed() view is deprecated. Please use the new class based view API.', category=DeprecationWarning)
 if (not feed_dict):
  raise Http404('No feeds are registered.')
 try:
  (slug, param) = url.split('/', 1)
 except ValueError:
  (slug, param) = (url, '')
 try:
  f = feed_dict[slug]
 except KeyError:
  raise Http404(("Slug %r isn't registered." % slug))
 if (not issubclass(f, LegacyFeed)):
  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)
 try:
  feedgen = f(slug, request).get_feed(param)
 except FeedDoesNotExist:
  raise Http404(('Invalid feed parameters. Slug %r is valid, but other parameters, or lack thereof, are not.' % slug))
 response = HttpResponse(mimetype=feedgen.mime_type)
 feedgen.write(response, 'utf-8')
 return response

def feed ( request , url , feed_dict = None ) : from django . contrib . syndication . feeds import Feed as LegacyFeed import warnings warnings . warn ( 'The syndication feed() view is deprecated. Please use the new class based view API.' , category = DeprecationWarning ) if ( not feed_dict ) : raise Http404 ( 'No feeds are registered.' ) try : ( slug , param ) = url . split ( '/' , 1 ) except ValueError : ( slug , param ) = ( url , '' ) try : f = feed_dict [ slug ] except KeyError : raise Http404 ( ( "Slug %r isn't registered." % slug ) ) if ( not issubclass ( f , LegacyFeed ) ) : 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 ) try : feedgen = f ( slug , request ) . get_feed ( param ) except FeedDoesNotExist : raise Http404 ( ( 'Invalid feed parameters. Slug %r is valid, but other parameters, or lack thereof, are not.' % slug ) ) response = HttpResponse ( mimetype = feedgen . mime_type ) feedgen . write ( response , 'utf-8' ) return response
provided for backwards compatibility .