@cache_page(60 * 60 * 168)  # 1 week.
def opensearch_plugin(request):
    """Render an OpenSearch Plugin."""
    host = u'%s://%s' % ('https' if request.is_secure() else 'http', request.get_host())

    # Use `render_to_response` here instead of `render` because `render`
    # includes the request in the context of the response. Requests
    # often include the session, which can include pickable things.
    # `render_to_respones` doesn't include the request in the context.
    return render_to_response(
        'search/plugin.html', {
            'host': host,
            'locale': request.LANGUAGE_CODE
        },
        content_type='application/opensearchdescription+xml'
    )
dataset/ETHPy150Open mozilla/kitsune/kitsune/search/views.py/opensearch_plugin/original