asgi

Django daphne asgi: Django can only handle ASGI/HTTP connections, not websocket

China☆狼群 提交于 2020-08-06 13:39:48
问题 This is really frustrating, I did set everything up according to the documentation, but daphne keeps throwing an error when I try to run it independently, it does work correctly when I use python manage.py run server . this is very frustrating and I can't seem to find similar error anywhere else 2020-01-25 09:57:17,627 INFO Starting server at tcp:port=8000:interface=127.0.0.1 2020-01-25 09:57:17,628 INFO HTTP/2 support not enabled (install the http2 and tls Twisted extras) 2020-01-25 09:57:17

Starlette + asyncio.create_task() doesn't log error if task object is stored in instance variable [duplicate]

社会主义新天地 提交于 2020-03-04 18:43:23
问题 This question already has answers here : When asyncio task gets stored after creation, exceptions from task get muted (2 answers) Closed 13 days ago . Okay, this is very weird, but here goes - import asyncio from starlette.applications import Starlette class MyTasks: def __init__(self): self.task = None async def main(self): self.task = asyncio.create_task(self.hello()) async def hello(self): raise ValueError async def main(): await MyTasks().main() app = Starlette(on_startup=[main]) $

Problem in running ASGI environments while deploying app Django Rest

自作多情 提交于 2020-01-16 08:16:42
问题 I am developing an app using Django,I have deployed it on Google Cloud Platform initially using WSGI environment,now I have made addition in app and used channels due to which I have to shift from WSGI to ASGI, but I am getting errors while deploying to Google Cloud Platform when I use ASGI environment I got the error: respiter = self.wsgi(environ, resp.start_response) TypeError: __call__() takes 2 positional arguments but 3 were given I commented the all content of WSGI file when I want to