The Python Agent for Metlo
Project description
Metlo API Security
Secure Your API.
Installation
Currently Metlo's Python Agent supports 2 servers:
- Django
- Flask
It can be installed from pypi
by running :
pip install metlo
Configuration
Django
Once installed, Metlo's middleware can be added by modifying middlewares list (in the projects settings.py
) like so:
MIDDLEWARE = [
...,
"metlo.django.MetloDjango",
]
and configuring a METLO_CONFIG
attribute in the projects settings.py
like this :
METLO_CONFIG = {
"API_KEY": "<YOUR_METLO_API_KEY>",
"METLO_HOST": "<YOUR_METLO_COLLECTOR_URL>"
}
METLO_CONFIG
can take an optional key-value pair representing the max number of workers for communicating with Metlo.
Flask
Once installed, Metlo middleware can be added simply like:
from flask import Flask
...
from metlo.flask import MetloFlask
app = Flask(__name__)
MetloFlask(app, "<YOUR_METLO_COLLECTOR_URL>", "<YOUR_METLO_API_KEY>")
The Flask Middleware takes the flask app, Metlo collector url, and the Metlo API Key as parameters. As an optional parameter, a named value can be passed for max number of workers for communicating with Metlo.
MetloFlask(app, "<YOUR_METLO_COLLECTOR_URL>", "<YOUR_METLO_API_KEY>", workers="<WORKER-COUNT>")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.