Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 1.18 KB

README.md

File metadata and controls

43 lines (28 loc) · 1.18 KB

Revenium Middleware for Python Django

Django middleware to dispatch metering metadata for HTTP API calls to Revenium.

Installation

pip install hypercurrent_metering
pip install hypercurrent_django

Usage

In your settings.py file in your Django project directory, please add the following to the middleware array:

'hypercurrentdjango.middleware.HyperCurrentMiddleware'

Configuration

HYPERCURRENT_API_KEY

(required), string, your Revenium API Integration Key

HYPERCURRENT_APPLICATION_HEADER

(optional), string, the HTTP header to determine the API consumer. The default is "clientId".

HYPERCURRENT_METADATA_HEADER

(optional), string, An optional response header to extract metering metadata from.

HYPERCURRENT_API_URL

(optional), string, the Revenium API URL. You should only need to change this if using a non-US based Revenium instance (ie, EMEA or customer compute.)

Example Application

See hello_project base file folder to see an example of how the middle ware can be implemented.