Questions tagged [quart]

Quart is a microframework for developing web applications using Python's asyncio library.

Quart is an evolution of the Flask API to work with Asyncio and to provide a number of features not present or possible in Flask.

Compatibility with the Flask API is, however, the main aim, which means that the Flask documentation is an additional useful source of help.

The latest documentation for Quart can be found here

Quart is developed on GitLab. You are very welcome to open issues or propose merge requests.

167 questions
1
vote
1 answer

Scheduling periodic function call in Quart/asyncio

I need to schedule a periodic function call in python (ie. called every minute), without blocking the event loop (I'm using Quart framework with asyncio). Essentially need to submit work onto the event loop, with a timer, so that the webserver keeps…
Crowphale
  • 13
  • 2
1
vote
0 answers

Running Quart on Cloudlinux's Passenger

I would like to use Quart on my LiteSpeed server which supports "Python Selector". I was able to deploy Flask but when I tried to do the same with Quart, it failed. I'm sure it is because Flask runs on WSGI while Quart on ASGI. I tried using things…
NORXND
  • 103
  • 1
  • 8
1
vote
0 answers

Asyncio coroutine handling

I've created a text game in Python which interacts using WebSockets, through Quart. So the server file looks like this: import asyncio from quart import Quart, render_template, websocket import Rpg app = Quart(__name__, …
Nick M
  • 69
  • 7
1
vote
1 answer

Quart got an unexpected keyword argument 'loop' when run from bot.loop.create_task

I am trying to add a web ui to a discord bot using Quart. From what I've seen the appropriate way to do this is to from a instance of discord.Bot create a task and to run it. I'm currently doing it this way def start(): …
dev
  • 95
  • 2
  • 12
1
vote
0 answers

Are Python Quart server and JS SocketIO client compatible?

On my current server, I have large blocks of calculations when I receive socketio events. (Server is using Flask + flask-socketio.) I'm moving the server from local version serving only one user to cloud version serving company-wise. I tested the…
Yan Yang
  • 1,804
  • 2
  • 15
  • 37
1
vote
1 answer

Migrating a Quart project with websockets from asyncio to trio

I'm trying to convert my asyncio project to trio. I understand that I have to use memory channels instead of Queues but for some reason I don't have the result I'm expecting. My main problem is that when I run two clients, the first one does not get…
tibs
  • 13
  • 3
1
vote
1 answer

Is there a library like werkzeug's ProxyFix to fix the request.remote_addr but for Quart / Hypercorn ASGI servers?

I am trying to run a Quart app behind an NGINX reverse proxy, but need to be able to use the request.remote_addr to determine the ip address of the client connection. When doing this with Flask I've always used the werkzeug ProxyFix package…
Jay Tuckey
  • 91
  • 1
  • 7
1
vote
1 answer

Running Quart in production behind Hypercorn

Hey guys I am trying to run Quart in production. That is my code: setups.py import quart.flask_patch from db import * from http import HTTPStatus from typing import Optional import flask.json from quart import ResponseReturnValue, jsonify,…
matisa
  • 497
  • 3
  • 25
1
vote
1 answer

AsyncIOMotorClient does not connect to local mongodb

I am trying to move my web blog-like app from Flask to Quart which aparently could significantly improve the performance. However, I am not able to replicate flask_mongoengine behaviour. So far I tried AsyncIOMotorClient and quart-motor. If I…
Anatoly Bugakov
  • 772
  • 1
  • 7
  • 18
1
vote
0 answers

Quart application - "No WebSocket UPGRADE"?

I am coding a discord bot and running a Quart Server asyncronously. Everything was fine, until this error popped up: No WebSocket UPGRADE hdr: None Can "Upgrade" only to "WebSocket". app/app.py: from quart import Quart, render_template, redirect,…
Rafael Setton
  • 352
  • 1
  • 8
1
vote
1 answer

How can I run a function after each request to a static resource in Flask?

I have a Flask (It's not actually Flask, it's Quart, an asynchronous version of Flask with the same syntax and features) application that serves static files that are created temporarily by a command line tool. I want to delete the files after they…
Finnbar M
  • 170
  • 1
  • 6
1
vote
1 answer

Using Quart in Heroku

Right now I'm trying to host a Quart web app on Heroku. Here is my test code: #quartTest.py from quart import Quart, request, Response app = Quart(__name__) @app.route('/') def index(): return 'hello world' if __name__ == '__main__': …
Bento Bot
  • 78
  • 1
  • 5
1
vote
1 answer

Setup Quart server with HTTP/2

I am trying to setup a Quart server to play with HTTP/2. I have been trying to go through the minimal documentation at: https://gitlab.com/pgjones/quart Where I have: $ cat app.py from quart import Quart, render_template, websocket app =…
malat
  • 12,152
  • 13
  • 89
  • 158
1
vote
1 answer

Can Make PUT and GET calls to Quart Schema, but not POST?

I am working on developing an API for a web application using Quart and Quart-Schema. GET and PUT calls to the API work fine. The API is running in Kubernetes hosted on DigitalOcean. All the calls work fine on the docs page. POST calls are not…
1
vote
1 answer

asyncio Discord bot session timeout on Quart web app

I'm trying to implement a discord bot connection to a web app running on Quart. I tried using one of the solutions posted here, which works for a while, but after about 24 hours the app breaks returning asyncio.exceptions.TimeoutError data =…
TheV
  • 63
  • 7