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
2 answers

How to pass asyncio.get_event_loop() to quart in command line?

In a doc they passed event loop to quart. Need to call async method in route handler. How to change this to command line for heroku? if __name__ == '__main__': loop=asyncio.get_event_loop() app.run(loop=loop) I tried web: hypercorn -b…
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
1 answer

Hierarchy of routes without overwriting handlers

I'm writing a flask application. It makes sense to have multiple endpoints, like that: prefix + '/' prefix + '/' prefix + '//parameters' prefix + '//parameters/' However, if I try to declare them all inside a blueprint, I'm…
ntakouris
  • 898
  • 1
  • 9
  • 22
0
votes
0 answers

PytestCollectionWarning: cannot collect 'test_app' because it is not a function. async def __call__(

PytestCollectionWarning: cannot collect 'test_app' because it is not a function. async def call( Here test_app is an isnatance of quart app: # Create the Quart app test_app = app.create_app() def event_runner(): policy =…
Harish
  • 1
0
votes
0 answers

Non awaited task seems to be awaited on. Python Quart

Code below for reference import asyncio from models import database from quart import Quart, request, abort, jsonify app = Quart(__name__) async def process_input(*args) -> None: """ Series of time consuming steps""" response =…
FAD
  • 31
  • 2
0
votes
1 answer

Stop quart from Logging

I am trying to disable all console output from quart. According to their site it works this way: from logging.config import dictConfig dictConfig({ 'version': 1, 'loggers': { 'quart.app': { 'level': 'ERROR', }, …
user2741831
  • 2,120
  • 2
  • 22
  • 43
0
votes
0 answers

Getting Spotify API client outside of Flask route function and into other file

I'm using Flask(/Quart) to get Spotipy API (Spotify Python Wrapper) authorization, and I want to use the authorized client I get in my successful_auth function in a different python file. My Flask(/Quart) website is purely for OAuth2, so once the…
0
votes
1 answer

How to use quart-db with hypercorn?

I'm trying to use the quart-db extension to connect to a postgresql DB from a Quart app that is served by hypercorn. But I'm not understanding how to use the db connection for an app that is served by hypercorn where the app initialization and…
Rusty Lemur
  • 1,697
  • 1
  • 21
  • 54
0
votes
1 answer

Passing parameters to Hypercorn when Quart is used in development mode

When running say: export QUART_APP=hello-world:app quart run As far as I understand you actually have three logging mechanisms in place, one set up by Hypercorn, another set up by Quart itself and another one set by AsyncIO module. In my case, in…
jonathans
  • 320
  • 3
  • 9
0
votes
1 answer

Collecting application level metrics in a Quart multiprocess setup

I have a quart app that is running with hypercorn on production. Eight worker hypercorn processes are configured to be started. My objective is to collect application performance logs such as latency, throughput using prometheus. From the quart app…
shshnk
  • 1,621
  • 14
  • 26
0
votes
0 answers

Quart Asyncio Python MessageQueue for Facebook Messenger Bot

I am developing a Facebook Bot for my brothers mobile auto repair that's supposed to be a live support agent essentially to try to figure out what the issue is before he jumps in. The issue I'm having is this -- I originally had it responding to…
Zach Handley
  • 914
  • 1
  • 12
  • 25
0
votes
1 answer

Quart `json_provider_class` makes no effect

I am trying to modify my datetime object responses in Quart so that my frontend applications receive dates in ISO8601 format. I expected the json_provider_class to do this job, but it's not working for me or maybe I am not doing it right. Here's my…
Athus Vieira
  • 403
  • 1
  • 4
  • 14
0
votes
0 answers

Safari cannot talk to my local quart_cors server due to CORS issues

I am trying to connect my simple python server up to talk with my local safari browser. I have no issues at all with Google Chrome, but when I use Safari, I get "Fetch API cannot load xyz URL due to access control checks". Here is my python…
logankilpatrick
  • 13,148
  • 7
  • 44
  • 125
0
votes
0 answers

How do I modify the jinja_loader.searchpath in a quart application?

I have this code: app=Quart(__name__) print(app.jinja_loader.searchpath) app.jinja_loader.searchpath.append(os.path.join(os.getcwd(),app.config["BASE_TEMPLATE_FOLDER"])) print(app.jinja_loader.searchpath) app.config["BASE_TEMPLATE_FOLDER"] returns…
yungmaz13
  • 139
  • 11
0
votes
0 answers

ConnectionAbortedError when the page's loading is canceled by the user (Python3 Quart)

The error ConnectionAbortedError is thrown if the page's loading is canceled when using a Python3 Quart webserver. Using @app.errorhandler(ConnectionAbortedError) with an appropriate function is completely ignored. How do I handle this error? Edit -…
poppy
  • 3
  • 4