Horizon Middleware

Horizon Middleware


class horizon.middleware.HorizonMiddleware[source]

The main Horizon middleware class. Required for use of Horizon.

process_exception(request, exception)[source]

Catches internal Horizon exception classes.

Exception classes such as NotAuthorized, NotFound and Http302 are caught and handles them gracefully.


Adds data necessary for Horizon to function to the request.

process_response(request, response)[source]

Convert HttpResponseRedirect to HttpResponse if request is via ajax.

This is to allow ajax request to redirect url.


class horizon.middleware.OperationLogMiddleware[source]

Middleware to output operation log.

This log can includes information below:

  • domain name
  • domain id
  • project name
  • project id
  • user name
  • user id
  • request scheme
  • referer url
  • request url
  • message
  • method
  • http status
  • request parameters

and log format is defined OPERATION_LOG_OPTIONS.

process_exception(request, exception)[source]

Log error info when exception occurred.

process_response(request, response)[source]

Log user operation.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.