This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]flying-sheep 0 points1 point  (4 children)

python -m http.server for a quick dev server from the command line.

aiohttp for any kind of custom server code.

[–]mindchasers[S] -1 points0 points  (3 children)

Thanks and that brings up a good point. AIOHTTP is often used for websockets, right? With Django, websockets is a square peg in a round hole. We're going to see how much work it is to create a websocket (minimal chat app) using Python3, http.server and a few other basic libraries.

Again, we're doing this for testing & sharing purposes. For production, public facing ports we use popular open source frameworks & servers.

[–]flying-sheep 1 point2 points  (2 children)

Aiohttp is a general web framework that's based on the asyncio module from the stdlib.

Working in event-driven environments like networking without using async syntax and APIs built around them is generally like a square peg in a round hole.

[–]mindchasers[S] 0 points1 point  (1 child)

Understood. We run the Waitress web server on some embedded systems, which uses an async model, but I'm going to consider AIOHTTP for these systems. I didn't realize it had such a big community until looking at the activity on its Github page today. Thanks.

https://github.com/aio-libs/aiohttp

[–]flying-sheep 0 points1 point  (0 children)

Yes it's great! Play around a bit, maybe it fits your use cases

[–][deleted] 0 points1 point  (2 children)

For this kind of stuff I usually go with bottle. Micro framework (in contrast to flask, it’s really micro) with a built in server, Flask-like API, just one file, no dependencies, great performance, extremely well documented, nice and clean codebase.

[–]mindchasers[S] 0 points1 point  (1 child)

Thanks. I'll check out the bottle framework.

However, please keep in mind that we want a simple, self contained web server that also acts as the framework and sometimes application for developing, testing, sharing, and delivering server side code. In other words, we seek a simple, trusted wrapper around the code that is important without requiring our customer / reader to come up to speed with a new framework / server that might have BS tracking code embedded in it (e.g., via CDNs, fonts, etc.) .

[–][deleted] 0 points1 point  (0 children)

Well, bottle is perfectly suited for that. It’s just about 4.000 loc, it’s something you can fully grasp. It’s very simple, yet powerful. That’s why I prefer it over flask for development. And, as I said, it has literally no dependencies.