Template tag to render a category with all it's entries.

def render_category(slug):
    """Template tag to render a category with all it's entries."""
    try:
        category = EntryCategory.objects.get(slug=slug)
    except EntryCategory.DoesNotExist:
        pass
    else:
        return {'category': category}
    return {}