Skip to main content

django-crequest

Overview

  • 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.

Installing

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

  • Add crequest to INSTALLED_APPS in your settings.py

  • Add crequest.middleware.CrequestMiddleware to MIDDLEWARE_CLASSES after the authentication and session middleware.

Supported Python versions

django-crequest currently can be run on multiple python versions:

  • Python 2

  • Python 3

  • PyPy

How to use

First import the crequest’s middleware:

from crequest.middleware import CrequestMiddleware

Get the current request ;):

current_request = CrequestMiddleware.get_request()

Done.

In depth & Complex details

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.

Metadata

Release files for django-crequest 2018.5.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-crequest 2018.5.11
File Size Uploaded
django-crequest-2018.5.11.tar.gz 4.4 kB Details

Release files / django-crequest-2018.5.11.tar.gz

Download URL django-crequest-2018.5.11.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e623ec6b2933790717307d5a59cf9db39ff4928b53c506948e1d05776ef4a034
BLAKE2b-256 checksum
How to use checksums
0f61d2e95ff46d2d117b79873d6922665d711b35357b50b854a0e9cf42806431
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

2018.5.11 This release

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page