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 django-detailed-request-logging
package to the requirements.txt
file.
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.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 010c83d185c6eaa7e8730cdd6014f366c586bfeacf7591e5cdcef11e9d6edff7 |
|
MD5 | a8411efb8f748cc5b1187f709a2bf726 |
|
BLAKE2b-256 | 70a69c2ba18917a8fa72a3db7e1670748f2526d7638dec3e38544f4d02ff8771 |
Close
Hashes for django_detailed_request_logging-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b9e74f7a7736d25633be0969f7ef9bd9f3b0ec00aef0544f8f31cb4ef9ee709 |
|
MD5 | 6d702d35b8f85e91f8499f95fa4f6930 |
|
BLAKE2b-256 | c3602217a38ddd22e3aeea057b11a255854e8779e7f97688c5bb4031562b3837 |