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,stubs]
- 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
File details
Details for the file django-detailed-request-logging-1.2.0.tar.gz
.
File metadata
- Download URL: django-detailed-request-logging-1.2.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19b517a6a400ddf2a4f46d44832f30f428a15ff2dbbcd99af8714a3cbdd4936c |
|
MD5 | 179449e30872d9926c255e1a69d05d87 |
|
BLAKE2b-256 | e0b305a9c01fe32a1f726496440ee1a2f26128e1d6f27266790730b5c9cd446d |
File details
Details for the file django_detailed_request_logging-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: django_detailed_request_logging-1.2.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46b25a4958c11880d081b8a9fe42a996343af45e2f3bcb28d70335514000dda8 |
|
MD5 | 3bab899b0d4539f64da55ce46b88417f |
|
BLAKE2b-256 | 1bfc8e00d08baf36c462cb9da81f86732580695407a38185a318e3db46280312 |