Horizon Middleware


class horizon.middleware.HorizonMiddleware(get_response)[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.


class horizon.middleware.OperationLogMiddleware(get_response)[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 in OPERATION_LOG_OPTIONS.

process_exception(request, exception)[source]

Log error info when exception occurred.