Skip to main content

Django middleware that keep request instance for every thread.

Project description

Django middleware that keep request instance for every thread.


pip install django-middleware-global-request


  1. Add django application django_global_request to INSTALLED_APPS in

  1. Add GlobalRequestMiddleware to MIDDLEWARE in

  1. Get request instance with function get_request from django_global_request.middleware

from django_global_request.middleware import get_request

class TestModel(models.Model):

    field1 = models.CharField(max_length=32)

    def hello(self):
        request = get_request()

Project details

Download files

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

Source Distribution

django-middleware-global-request-0.1.1.tar.gz (2.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page