#35701: Class BaseView. Use gzip_page Error: 'coroutine' object has no attribute
'streaming'
-------------------------+-----------------------------------------
     Reporter:  Ingward  |                     Type:  Bug
       Status:  new      |                Component:  Generic views
      Version:  5.1      |                 Severity:  Normal
     Keywords:           |             Triage Stage:  Unreviewed
    Has patch:  0        |      Needs documentation:  0
  Needs tests:  0        |  Patch needs improvement:  0
Easy pickings:  0        |                    UI/UX:  0
-------------------------+-----------------------------------------
 Can I use a decorator "gzip_page" with an asynchronous server and an
 asynchronous function async def get(self, request, *args, **kwargs): ?


 {{{
 from django.views.decorators.cache import never_cache
 from django.views.decorators.csrf import csrf_protect
 from django.views.decorators.gzip import gzip_page

 @method_decorator([never_cache, csrf_protect, gzip_page], name='dispatch')
 class AccountIn(View):
     async def get(self, request, *args, **kwargs):
         return TemplateResponse(request, 'accounts/login.html',
 context={})
 }}}

 Server :

 import uvicorn

 if __name__ == '__main__':
     uvicorn.run("app.asgi:application", reload=True, port=5000,
 log_level="info", lifespan='auto')

 Error:

 'coroutine' object has no attribute 'streaming'
 ...Lib\site-packages\django\middleware\gzip.py, line 20, in
 process_response
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35701>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107019179bca5ee-ebfa34df-7bf8-4e2c-8fe7-0c03a6ed9750-000000%40eu-central-1.amazonses.com.

Reply via email to