Middleware to log requests in Django with more detailed information.
Project description
django-detailed-request-logging
Releases
This project follows the semantic versioning specification for its releases.
Development
Requirements
- Python >=3.7
- Django >=3.2
- django-rest-framework >=3.12
Setup
- Create and activate a python3 venv.
- Install the library in the editable mode
pip install -e .[test]
- Install dev requirements
pip install -r requirements-dev.txt
. - Install git hooks to automatically format code using black with
pre-commit install
Installation
From git in requirements.txt
To install this package from this git repository, add the following to the requirements.txt
file:
git+ssh://git@git.dcc.sib.swiss/biwg/libweb/django-detailed-request-logging.git@master#egg=django-detailed-request-logging
To use it, add the following entry to MIDDLEWARE
inside of your settings.py
file:
MIDDLEWARE = [
...,
"django_detailed_request_logging.middleware.LoggingMiddleware",
]
Then, add a new entry LOGGING_REQUEST_MIDDLEWARE
to your settings.py
file, changing the value of apps
to the
names of the apps you want to log requests on and changing the value of skip_methods
to include all HTTP methods
you do NOT want to get logged:
LOGGING_REQUEST_MIDDLEWARE = {
"apps": ("projects",),
"skip_methods": ("OPTIONS",),
}
Project details
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
Close
Hashes for django-detailed-request-logging-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 430641f7d775d17e25aebe28107f04de30cfdfda35a8a28b692cc04e088db976 |
|
MD5 | 85e5f824eb8df28af13fb27bb8810cba |
|
BLAKE2b-256 | 45c7a42b771d9424ca44711179f77a521a8d1304ffb8b5d86d46d1720c057732 |
Close
Hashes for django_detailed_request_logging-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 440548ee09c1e8b21dd375cc610e1e0423321375f35389e02c6f1faf8306ae14 |
|
MD5 | 871c647b992b3dbfdfe832da5397102e |
|
BLAKE2b-256 | 45a2574a2bd434b5a5ec2bbdf3a165e7f97a52abb7b423813e53f534558e048f |