Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
.. contents::
crequest
takes care of current request
in silent way.crequest
will bring you current request
object of your Django application from anywhere in your code.django-crequest
is available on http://pypi.python.org/pypi/django-crequest
So it can be installed it by pip::
$ python pip install django-crequest
Or you can grab the latest version tarball and ::
$ python setup.py install
To enable django-crequest
in your project
crequest
to INSTALLED_APPS in your settings.pycrequest.middleware.CrequestMiddleware
to MIDDLEWARE_CLASSES
after the authentication and session middleware.django-crequest
currently can be run on multiple python versions:
First import the crequest's middleware::
from crequest.middleware import CrequestMiddleware
Get the current request
;)::
current_request = CrequestMiddleware.get_request()
Done.
Set the current request in UnKnown situations::
CrequestMiddleware.set_request(request)
Return iam_request if there is no current request::
CrequestMiddleware.get_request(iam_request)
And finally delete::
CrequestMiddleware.del_request()
The middleware automatically sets/deletes the current request for HTTP requests. For other uses (management commands, scripts), you will need to do this yourself.
FAQs
Middleware that makes the current request available from anywhere.
We found that django-crequest demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.