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.
Source Distribution
Built Distribution
File details
Details for the file metlo-0.1.3.tar.gz
.
File metadata
- Download URL: metlo-0.1.3.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26fa4804381b249714e63b329d8d3d943352830bb8d9a9bd93d762e730caa40e |
|
MD5 | 9f0b2d35f7cdf452301b25bed86724e9 |
|
BLAKE2b-256 | 89c6ca74eefa928c356138acc26e5a1c604826b850599f11c788ba7a3a42d214 |
File details
Details for the file metlo-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: metlo-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd978dd12dec7c44857fa0767bd3f562b5aa69e9b0dd09f93dfdc6d5022a7a9e |
|
MD5 | 0d435fd12755981333e06c9db6a6094c |
|
BLAKE2b-256 | 843318b612185d57b56463ed8431bf3d5c975a85001f7143e3966cbb71f1d59e |