Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Middleware to make current request always available.

Project Description


  • 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 So it can be installed it by pip:

$ python pip install django-crequest

Or you can grab the latest version tarball and

$ python install

To enable django-crequest in your project

  • Add crequest to INSTALLED_APPS in your
  • 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()


In depth & Complex details

Set the current request in UnKnown situations:


Return iam_request if there is no current request:


And finally delete:


The middleware automatically sets/deletes the current request for HTTP requests. For other uses (management commands, scripts), you will need to do this yourself.

Release History

Release History

This version
History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-crequest-2016.3.16.tar.gz (4.1 kB) Copy SHA256 Checksum SHA256 Source Mar 16, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting