Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ea5e98 commit eb7c0a7Copy full SHA for eb7c0a7
tests/middleware_exceptions/middleware.py
@@ -1,3 +1,5 @@
1
+import asyncio
2
+
3
from django.http import Http404, HttpResponse
4
from django.template import engines
5
from django.template.response import TemplateResponse
@@ -11,6 +13,9 @@
11
13
class BaseMiddleware:
12
14
def __init__(self, get_response):
15
self.get_response = get_response
16
+ if asyncio.iscoroutinefunction(self.get_response):
17
+ # Mark the class as async-capable.
18
+ self._is_coroutine = asyncio.coroutines._is_coroutine
19
20
def __call__(self, request):
21
return self.get_response(request)
0 commit comments