Abort the current request with a 405 (Method Not Allowed) response
    code. Sets the ``Allow`` response header to the return value of the
    :func:`Resource.get_allowed_methods` function.

    :param instance: Resource instance (used to access the response)
    :type instance: :class:`webob.resource.Resource`
    :raises: :class:`webob.exceptions.ResponseException` of status 405

def raise_405(instance):
    """Abort the current request with a 405 (Method Not Allowed) response
    code. Sets the ``Allow`` response header to the return value of the
    :func:`Resource.get_allowed_methods` function.

    :param instance: Resource instance (used to access the response)
    :type instance: :class:`webob.resource.Resource`
    :raises: :class:`webob.exceptions.ResponseException` of status 405
    """
    instance.response.status = 405
    instance.response.headers['Allow'] = instance.get_allowed_methods()
    raise ResponseException(instance.response)