api.middleware

HTTP middleware for the Deis REST API.

See https://docs.djangoproject.com/en/1.6/topics/http/middleware/

class api.middleware.APIVersionMiddleware[source]

Return an error if a client request is incompatible with this REST API version, and include that REST API version with each response.

process_request(request)[source]

Return a 405 “Not Allowed” if the request’s client major version doesn’t match this controller’s REST API major version (currently “1”).

process_response(request, response)[source]

Include the controller’s REST API major and minor version in a response header.