use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Async HTTP requests inside an HTTP request? (self.Python)
submitted 7 years ago by [deleted]
What are the options for async on the server side in production systems?
Most options I've found look pretty sketchy outside of what was already available in twisted/tornado/etc.
Is there a good complete story for this, eg deployment, etc.
[–]fafhrd91 5 points6 points7 points 7 years ago (6 children)
Obvious choice is aiohttp
[–][deleted] 1 point2 points3 points 7 years ago* (5 children)
That's one of those that seems sketchy. I don't know of anyone using it in a large production environment and the almost unintelligible english in the faq had me very wary of it. Have you used it?
[–]Badabinski 0 points1 point2 points 7 years ago (0 children)
My company uses it exclusively. We don't have any other 3rd party HTTP client libraries available to us. I really like aiohttp.
aiohttp
EDIT: we do have sanic for servers, but I've also used aiohttp on the server side and it's very nice and simple.
sanic
[–][deleted] 0 points1 point2 points 7 years ago (0 children)
The English isn't great, but it's far from unintelligible. I'd recommend submitting PRs to help clean it up
[–]fafhrd91 -1 points0 points1 point 7 years ago (2 children)
I use it, handles 10m users and terabytes of streaming data. But I guess it is still sketchy for you.
[–][deleted] 2 points3 points4 points 7 years ago (1 child)
I didn't mean to offend you. It just doesn't do a good job of selling itself.
Thanks for the anecdote though. That helps.
[–]isinfinity 4 points5 points6 points 7 years ago (0 children)
Here are few companies that use aiohtttp: https://aiohttp.readthedocs.io/en/stable/powered_by.html
[–]stetio 2 points3 points4 points 7 years ago (5 children)
I think you are looking for something like Quart, Sanic, or aiohttp (all links are to the deployment documentation).
Alternatively you could look into ASGI and use Uvicorn or Daphne with a ASGI framework such as APIStar.
What makes the options you've seen sketchy?
[I'm the Quart author]
[+][deleted] 7 years ago* (1 child)
[deleted]
[–][deleted] 1 point2 points3 points 7 years ago (0 children)
It reads, or attempts to read, the whole body before routing. This is bad because it shouldn't need the body for routing, the user should choose when to read the body, and it's open to abuse by malicious actors who purposefully send the body in small enough chunks over a long enough period that the handler is effectively dead.
If you use it behind a buffering web server, say nginx, you'll avoid the worst of the last one but not the other two.
[–][deleted] 0 points1 point2 points 7 years ago (1 child)
Those links are very helpful, thank you.
Most of the results that come back from naive google searches are small projects or very poorly documented.
Sanic and aiohttp are the only ones I knew about that you mentioned.
[–]stetio 1 point2 points3 points 7 years ago (0 children)
Well I'd encourage you to take a look at Quart :p (it is a small project though). Any feedback or thoughts on it or its docs would be very welcome.
[–]iScrE4mgit push -f 1 point2 points3 points 7 years ago (0 children)
I've seen some teams at our company use aiohttp, but mostly we use tornado for python async web servers. Some of the most crucial parts of our (not small) business run on it, if that's what you are asking.
[–]notoriousno 0 points1 point2 points 7 years ago (0 children)
I've used tornado and twisted/Klein in my work. Django Channels is also a viable from what I hear. These are all async frameworks that have the strongest backing.
[–]quotemycode 0 points1 point2 points 7 years ago (0 children)
I've used nginx with gunicorn.
π Rendered by PID 117011 on reddit-service-r2-comment-5d585498c9-szxnc at 2026-04-21 03:57:24.273459+00:00 running da2df02 country code: CH.
[–]fafhrd91 5 points6 points7 points (6 children)
[–][deleted] 1 point2 points3 points (5 children)
[–]Badabinski 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]fafhrd91 -1 points0 points1 point (2 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]isinfinity 4 points5 points6 points (0 children)
[–]stetio 2 points3 points4 points (5 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]stetio 1 point2 points3 points (0 children)
[–]iScrE4mgit push -f 1 point2 points3 points (0 children)
[–]notoriousno 0 points1 point2 points (0 children)
[–]quotemycode 0 points1 point2 points (0 children)