Skip to content

Instantly share code, notes, and snippets.

@Ruhshan
Last active February 19, 2018 09:13
Show Gist options
  • Save Ruhshan/e15a2e9ea8806216b0e81eccded66a45 to your computer and use it in GitHub Desktop.
Save Ruhshan/e15a2e9ea8806216b0e81eccded66a45 to your computer and use it in GitHub Desktop.
from django.conf import settings
from demoapp import models
def RequestExposerMiddleware(get_response):
def middleware(request):
models.exposed_request = request
response = get_response(request)
return response
return middleware
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment