def feed(request, url, feed_dict=None):
    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 __HOLE__:
        raise Http404, "Slug %r isn't registered." % slug

    try:
        feedgen = f(slug, request.path).get_feed(param)
    except feeds.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
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-0.96/django/contrib/syndication/views.py/feed