A simple way to implement request_id in Django
Project description
Request ID Django Log
Install
pip install request-id-django-log
Update your INSTALLED_APPS
and MIDDLEWARE
INSTALLED_APPS = [
...
"request_id_django_log",
]
MIDDLEWARE = [
...
"request_id_django_log.middleware.RequestIdDjangoLog",
]
Configure
The following options are used by this library:
REQUEST_ID_CONFIG = {
"REQUEST_ID_HEADER": "HTTP_X_REQUEST_ID",
"GENERATE_REQUEST_ID_IF_NOT_FOUND": True,
"RESPONSE_HEADER_REQUEST_ID": "HTTP_X_REQUEST_ID",
}
REQUEST_ID_HEADER
is the header name which will hold the received request_id. This must be used when another system is responsible for generating the request_ids and sending them to your django application.GENERATE_REQUEST_ID_IF_NOT_FOUND
If set to true, a new request_id will be generated if none was previously supplied.RESPONSE_HEADER_REQUEST_ID
sets the name of the response header which will hold the value of the request_id.
Supported Versions
python 2.7
with Django1.8
,1.9
and1.11
python 3.5
,3.6
and3.7
with Django1.8
,1.9
,1.11
,2.0
and2.1
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
Close
Hashes for request_id_django_log-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63e636dc73c529e98fb4588eb79ee1b2778ca5b0d6abb7f2221167a8c94c5eef |
|
MD5 | 31d0330536d5a1bc54c18d98a732d004 |
|
BLAKE2b-256 | 9e17d9bdbe22560dd3221be1df54291da3b256e665b0028a2fcdfe3cd08eb4d7 |
Close
Hashes for request_id_django_log-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b202535be8de5f9568686344f71a19b899ec021f216f61d1313de871959021b1 |
|
MD5 | e12f01ca25abe74ba1bdd2f547c691b7 |
|
BLAKE2b-256 | 0d114389bab39a5567af6e06f0512341f9ff78ca3a2173768ff6c830d26211a9 |