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
0
votes
0 answers

Django ASGI/Daphne: postgres connection timeout

In my project I am using a PG database. Now that I've deployed the app to the production server, I' ve switched from the test db (PG 10) to the production db (PG 9). When connecting the Django backend to the test db, everything works perfectly fine,…
0
votes
4 answers

Django Channels ASGI - AppRegistryNotReady: Apps aren't loaded yet

Running my project with python manage.py runserver boots it up perfectly using the channels asgi development server, however when running the project with Daphne (daphne project.routing:application) I get the error AppRegistryNotReady: Apps aren't…
rykener
  • 711
  • 1
  • 6
  • 16
0
votes
1 answer

Django, deploy to heroku with uvicorn

I have a Django app that is deployed to Heroku with daphne. I would like to replace daphne with uvicorn, so I changed my Procfile to the following: web: bin/start-pgbouncer uvicorn rivendell.asgi:application --limit-max-requests=1200 --port…
user12177026
0
votes
0 answers

Django Channel Error wile building a chat application

I am trying to build a chat application using Django and channel. But I am getting not able to get my view file (room.html) My main project name is "techChat" and I have a app called "chat" I ma trying all this code from :-…
rushabh
  • 71
  • 7
0
votes
1 answer

How can i use asgi completely in django?

I'm new to django. After searching here and their i found asgi enable performance boost over django wsgi based view. So that i want to completely switch to asgi view but i din't found any guides regarding to it so that i can i implement it in…
Sandeep
  • 33
  • 1
  • 5
0
votes
0 answers

Deploying Django with channels and asgi to heroku

I'm trying to update my Django Heroku server to run asgi as well and consume a WebSocket. I updated the settings, Procfile, asgi file But I can't seem to be able to consume the WebSocket, I get an error: 2020-08-20T12:55:16.708582+00:00 app[web.1]:…
user12177026
0
votes
0 answers

static files not found 404 django on development server

i couldn't find a solution after trying alot of solutions here, my problem is i'm running an ASGI app on a devlopement server and i can't get static files nor urls,it's working perfectly on local but not in server this server is running ubuntu and…
0
votes
1 answer

Django ASGI Deployment on Heroku

I want a clear cut explanation of how should I deploy Django 3.x and channels 2.x on Heroku. my asgi.py file import os import django from channels.routing import get_default_application os.environ.setdefault('DJANGO_SETTINGS_MODULE',…
kaizen
  • 53
  • 6
0
votes
2 answers

How to use 'async def' in django views?

#views.py async def test(request: ASGIRequest): return HttpResponse(b'hello') class Test(View): async def get(self, request: ASGIRequest): print(type(request)) print(dir(self)) return…
Cajio
  • 11
  • 1
  • 3
0
votes
0 answers

Django real time notification

I'm working on django project that requires a real time communication, i found on google that best way to do is using MQTT protocol, in this way i need to write my own broker by subclassing HBMQTT broker , but it seems hard to run MQTT broker and…
0
votes
1 answer

Unusual python function wrapper syntax

I'm going through django channels tutorial and I'm baffled by the async_to_sync syntax in the asgiref.sync module Specifically async_to_sync(self.channel_layer.group_add)( self.room_group_name, self.channel_name ) It says async_to_sync is…
0
votes
0 answers

Deployment of Django Channels App in Google Cloud Platform

I am working on my first django channels app and I want to deploy my django channel app in Google Cloud Platform,its working fine in local server,but when I deployed it on Google Cloud Platform,it gives me errors: WebSocket connection to…
Nabeel Ayub
  • 1,060
  • 3
  • 15
  • 35
0
votes
0 answers

django-channels does not work with daphne on linux server

I'm using Django-eventstream over Django channels to send an event to my client app (react using eventstream), on my local machine the events are sent correctly to the client. but when I upload the app to my Linux server the webhook just getting…
0
votes
1 answer

Hypercorn - Can't find __main__ module in folder

I'm using Quart(Flask async) with debug=True and its builtin Hypercorn server, but everytime I save a file and the application tries to restart, I get : C:\Users\myusername.virtualenvs\App-GtW9WS3s\Scripts\python.exe: can't find '__main__' module…
Mojimi
  • 2,561
  • 9
  • 52
  • 116
0
votes
1 answer

How to do HTTP/2 stream prioritization in an ASGI server?

I'm trying to implement the http/2 stack in my own app server which I've built from scratch using asyncio. As per my understanding, asyncio maintains a "tasks" queue internally which is used by the event loop to run tasks. Now, to implement stream…
Akshay Takkar
  • 500
  • 1
  • 7
  • 21
1 2 3
14
15