Request Context Manager
Purpose of Request Context
When application begins handling request, request context manager create a request context. Within request context, you could access the attributes bound with the context. If you try to access attributes outside the context, OutsideContext exception will be raised.
How to Create Request Context Manager
from request_context_manager import RequestContextManager
from request_context_manager import RequestContextAttr
# create request context manager
your_request_context_manager = RequestContextManager('your_request_context_manager_name')
# bind request context attribute
class YourRequestContextAttr:
_request_context_manager = your_request_context_manager
your_attr = RequestContextAttr('your_attr_name', _request_context_manager)
# get/set request context attribute within request context
with your_request_context_manager.under_request_context():
YourRequestContextAttr.your_attr.set("hello world")
your_attr_value = YourRequestContextAttr.your_attr.get() # "hello world"
Metadata
Release files for request_context_manager 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| request_context_manager-0.0.3.tar.gz | 5.7 kB | Without provenance | Details for request_context_manager-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| request_context_manager-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for request_context_manager-0.0.3-py3-none-any.whl |
Total release size: 9.1 kB
Release files / request_context_manager-0.0.3.tar.gz
| Download URL | request_context_manager-0.0.3.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49eb81e0ad33ec732c9c02653b6884fdced1cba48276fac99e2fb7e363aff17f
|
|
BLAKE2b-256 checksum How to use checksums |
7c65affea8fd185ab5a94159968c43b3865babe6455ff40ed6cd85726c1fe6bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|
Release files / request_context_manager-0.0.3-py3-none-any.whl
| Download URL | request_context_manager-0.0.3-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b5201c834f8a7426fd4d7d17f47e54117c60f869f88cad566432d5c2cbdae12
|
|
BLAKE2b-256 checksum How to use checksums |
cb8b088d904730f4ac99cef90a0087181598098875c885f9d0e28449dffa8fd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|
Security for request_context_manager 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.