Questions tagged [asgi]

ASGI stand for Asynchronous Server Gateway Interface (ASGI), a "spiritual successor to WSGI, intended to provide a standard interface between async-capable Python web servers, frameworks, and applications."

An ASGI app is a a double, asynchronous callable (scope and coroutine). The callable has send and receive awaitables, thus the ability to wait for incoming events and send outgoing events. Events essentially are dictionaries with a predefined format that form the basis of the standard.

Official ASGI documentation

212 questions
1
vote
1 answer

hypercorn: client-certificate verification

I'm trying to enable client certificate validation in hypercorn. If it matters, I'm using FastAPI. The documentation directs me to use the --verify-mode parameter and states simply: SSL verify mode for peer’s certificate, see ssl.VerifyMode enum…
JimmyJames
  • 1,356
  • 1
  • 12
  • 24
1
vote
1 answer

How to proxy both WSGI and ASGI via Uvicorn or Daphne with nginx and SSL proxy?

I have a small project that uses Django Channels (websockets) and it works fine locally. I've added SSL to my docker-based deployment with the letsencrypt-companion-container docker image, which, exposes 443, handles all the SSL, then funnels…
mkoistinen
  • 7,724
  • 3
  • 41
  • 56
1
vote
1 answer

Groups and channel layers make the process stop without raising exceptions

Starting with this very simple working code sample: from channels.generic.websocket import JsonWebsocketConsumer class IsacomptaManagementFeesConsumer(JsonWebsocketConsumer): pass When connecting to this websocket consumer from javascript,…
Antoine Pinsard
  • 33,148
  • 8
  • 67
  • 87
1
vote
1 answer

Django - How to share data between ASGI and WSGI applications?

I make my project on Django, it has Gunicorn on WSGI, Daphne on ASGI. ASGI server needed only for handling Websocket protocol. Using Channels in Django for Websocket routing and handling. Nginx on static and proxy. Database is Mysql. Generally: is…
ExtraALIEN
  • 11
  • 1
1
vote
1 answer

django channels vs daphene

I am little bit confused about the main roles of django-channels and uvicorn server. I have read a lot of blogs but did not get much clarification. If we can implement an ASGI server for websockets using channels, then why do we need asgi server…
gar
  • 389
  • 1
  • 3
  • 8
1
vote
2 answers

django.core.exceptions.ImproperlyConfigured: Cannot import ASGI_APPLICATION module 'routing'

I am trying to build a multiplayer game in Django, for which I needed to work on Django channels. but here's the issue while running it. Performing system checks... System check identified no issues (0 silenced). September 27, 2019 -…
Sachin
  • 185
  • 1
  • 3
  • 10
1
vote
2 answers

How to use telethon with hypercorn?

Telethon with quart How to use telethon with hypercorn? How to convert the following line app.run(loop=client.loop) In procfile, how to pass the loop hypercorn file:app -k asyncio Or how to use hypercorn api? import asyncio from hypercorn.asyncio…
Smart Manoj
  • 5,230
  • 4
  • 34
  • 59
1
vote
1 answer

Quart Bad Request syntax or unsupported method

Python 3.7 on windows When running the sample from quart from quart import Quart, websocket app = Quart(__name__) @app.route('/') async def hello(): return 'hello' @app.websocket('/ws') async def ws(): while True: await…
Smart Manoj
  • 5,230
  • 4
  • 34
  • 59
1
vote
0 answers

How to access the HTTP/2 stream id in the send callable to the asgi app?

I'm building an ASGI application server in python and implementing the HTTP/2 protocol. I receive raw bytes from a socket, parse the bytes and convert them into frame objects. When I trigger the ASGI application the send callable only gets an event…
1
vote
3 answers

Django Channels Worker is returning TypeError: zadd() got an unexpected keyword argument 'daphne

In my server, i am running a Daphne and a Worker for Django Channels. I have already reboot all containers (I use Docker), cleaned Redis Cache. Today, these applications stoped to work and return this stack: KeyError: 'leads-198' 2019-03-27…
0
votes
1 answer

Django - setting up Server-sent Events with Channels: Unhandled Exception: SseConsumer() missing 2 required positional arguments: 'receive' and 'send'

I have an existing Django Channels setup that is working with websockets and I have to add another endpoint to support SSE. I'm following an example from here https://channels.readthedocs.io/en/stable/topics/consumers.html to set up a consumer using…
Sthe
  • 2,575
  • 2
  • 31
  • 48
0
votes
0 answers

FastAPI with Ultralytics YOLOv8: "NameError: predictions is not defined"

I am using FastAPI to serve a Yolov8 trained model from the Ultralytics library for object detection. However, I'm encountering an issue when trying to predict using the loaded model. The specific error I get is: NameError: predictions is not…
J.c
  • 1
  • 1
0
votes
0 answers

django view function is not executing in asgi mode

I am using django development environment to develope an app while trying to execute view function i am getting raise SynchronousOnlyOperation(message) django.core.exceptions.SynchronousOnlyOperation: You cannot call this from an async context -…
Arif Khan
  • 1
  • 3
0
votes
0 answers

asgi config in Django

I implemented a chat environment with Django chat channel and it works with asgi, messages are exchanged on my computer without any problem, but when I upload my project on host, it does not exchange messages, I am wondering should I config my…
0
votes
0 answers

Django app page with Daphne asgi won't load after Google Cloud App Engine deployment

Receiving this error message ModuleNotFoundError: No module named 'trip_tracker_project' in the Google Cloud App Engine logs when trying to launch the application after deployment. There may be an issue with the asgi daphne spin up (the app uses…