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
3
votes
1 answer

Where is a complete example of testing with pytest using Quart's extension Quart-OpenAPI?

I'd like to use pytest with Quart's extension quart-openapi, but the documentation examples and googling have not helped. Where can I find a concrete, example of the pytest testing tool being used with quart-openapi? So far I've read through these…
Eli H.
  • 35
  • 9
2
votes
0 answers

Calling aiohttp in Quart generates An existing connection was forcibly closed by the remote host

When I try to make a get or post call using aiohttp in a Quart endpoint it throws 'An existing connection was forcibly closed by the remote host', even when I follow the official tutorial here Full exception stack: Exception in callback…
Swatcat
  • 73
  • 6
  • 21
  • 57
2
votes
1 answer

Python Quart import error : cannot import name 'soft_unicode' from 'markupsafe'

I am installing the Quart module for Python on a newly upgraded server - to Debian 11: name -a Linux 9D895EB 5.10.0-19-amd64 #1 SMP Debian 5.10.149-2 (2022-10-21) x86_64 GNU/Linux When I try running Quart I get the following: Traceback (most recent…
Swatcat
  • 73
  • 6
  • 21
  • 57
2
votes
0 answers

ModuleNotFoundError: No module named 'quart'

Ubuntu 22.10, Python 3.10.7. I have Quart = "*" in Pipfile, after running pipenv install, still run into this error.
Kok How Teh
  • 3,298
  • 6
  • 47
  • 85
2
votes
1 answer

Quart discord.py on Heroku : loop attribute cannot be accessed in non-async contexts

I am using Quart and Discord.py to build a discord bot. i run the two with this method. app.app_context() bot.loop.create_task(app.run_task(host="0.0.0.0", port=80)) bot.run(Discord_Dev_Token) i tried to deploy the project into heroku service and…
2
votes
1 answer

python quart rendering templates

I have problem with rendering html / css. main: from quart import Quart, render_template, redirect, url_for app = Quart(__name__) @app.route("/") async def index(): return await…
2
votes
1 answer

Quart framework WARNING:asyncio:Executing

We are using Quart (Flask+asyncio) Python web framework. Every time the request is processed and the response is sent to a client, this (or similar) message is logged: WARNING:asyncio:Executing
Michal Moravik
  • 1,213
  • 1
  • 12
  • 23
2
votes
1 answer

Python runs old functions

I have a project build with PY3 with Quart. I run it with hypercorn. I have deployed a new version, but when I post a request I get old response. I did a simple test, and wrote a static response in one of my routes to see the change. Nothing. I have…
matisa
  • 497
  • 3
  • 25
2
votes
1 answer

Cannot use request and yield in quart handler

I am trying to use async generator and quart to stream the result of bigger queries. However I am stuck in yielding from an async function while using the request argument of the HTTP query from quart import request, Quart app =…
Bigbohne
  • 1,356
  • 3
  • 12
  • 24
2
votes
0 answers

Quart Python Error: jinja2.exceptions.TemplateSyntaxError: expected token ',', got 'string'

I code a discord panel and I would like to put a text in another variable with quart python:
Jourdelune
  • 131
  • 8
2
votes
1 answer

How to turn on debug mode with hypercorn.asyncio.serve(app,quart_cfg)

Have problem with using quart server with telethon library, but cannot handle the error. Trying to turn debug mode on, but it says that Warning: The config debughas no affect when using serve warnings.warn("The configdebug has no affect when using…
lorrod
  • 21
  • 3
2
votes
1 answer

Modifying quart.request - acceptable? (Python API)

I need to store some per-request metrics and telemetry (such as timestamps, etc) in quart (the python web framework). Is it acceptable behaviour to modify quart.request and add variables? It appears to work, and it's similar to how I would have…
Niklas B
  • 1,839
  • 18
  • 36
2
votes
1 answer

Why run Quart app with Hypercorn / isn't it automatic?

If you inspect the Quart library, app.run() just establishes some config and then uses asyncio.run(serve(self, config)), where serve comes from from hypercorn.asyncio import serve. So even if you run a Quart app via python myapp.py, isn't it…
jsstuball
  • 4,104
  • 7
  • 33
  • 63
2
votes
1 answer

Can Quart (the ASGI Flask alternative) be proxied through nginx?

I currently have a Flask app proxied behind Nginx via uWSGI. Due to my needs for asyncio and websockets, I would prefer to switch to Quart. I use nginx to manage authentication and performantly/simply serve static files. It would be nice to keep…
trbabb
  • 1,894
  • 18
  • 35
2
votes
1 answer

How to add gzip compression to Hypercorn server serving a Quart app

I have a quart app running on a hypercorn (0.6) server. (EC-2 amazon Ubuntu 18) The page loads too slow and one of the recommendations is to add gzip compression. Does anyone have experience with this? kind regards, alex
socialb
  • 135
  • 1
  • 9
1
2
3
11 12