Nobody seems to be asking why Python doesn't have the equivalent of Go's net/http. I think Django is justified given how powerful it is, but these micro-frameworks are ridiculous.
https://docs.python.org/3/library/http.server.html#module-ht...
31–40 of 49 posts
Nobody seems to be asking why Python doesn't have the equivalent of Go's net/http. I think Django is justified given how powerful it is, but these micro-frameworks are ridiculous.
https://docs.python.org/3/library/http.server.html#module-ht...
Are there any good alternatives to gunicorn out there that don't require async? We're not ready to migrate everything to async, but gunicorn's forking model is blowing up on macOS 15.
FastAPI uses uvicorn which is ASGI, but you can choose to implement endpoints as either async or sync. I have implemented servers using both styles. Very pleasant to work with, and everything is type hinted, which is a must for me in any serious Python project.
If for some reason you need to mix sync/async views (maybe during a migration) you can use uvicorn as a gunicorn worker type, and run multiple workers. But your async views will still scale much better.
I was trying to see the value of this as well, but I don't know Python well enough. Maybe there is no ASGI for python? And I assume Python cannot handle it's own HTTP server (using threads, similar to Javalin's virtual threads)? I always cringe when a programming language needs to find another solution/language to handling its processes. I understand why you will need a load balancer, but for small, simple projects,…
There is plenty. FastAPI, Starlite and Flask are all ASGI. Yes, Python has its own ASGI HTTP Servers, Uvicorn and Hypercorn are two most common. I agree, I'm not sure what this project aims to fix over other more established projects.
Earlier quoted context omitted.
I have just recently been looking into this. What would you normally reach for when doing templating?
HTML-based templating is toxic to a codebase, especially django templating. It is untyped, impossible to compile and trust, and it's horrible to maintain. Use React and JSX (TSX, to be more specific). NextJS does good quality SSR, use that if you want an app that is also usable without JS. Anybody not in that ecosystem /right now/ is going to be lagging behind by so much in velocity and capability, and will get eaten…
I see the velocity, but high magnitude doesn't mean that you're going the right direction.
Feels like an in-between library that I'm not sure has a great fit in the current Python BE environment. It's not as batteries-included as Django, primarily because Django's the incumbent and the ecosystem is vast. It's not as modular and independent as Flask, which it's taking a lot of inspiration from. It doesn't seem to bring enough to the table to be flat out better all-rounder than FastAPI. I'm quite unsure wher…
FastAPI also supports dependency injection.
I've actually used FastAPI's DI, which is a nice convenience. It didn't feel as a big selling point, again, due to this being Python. Wrapping up your own DI is near trivial, and barely feels like a pattern.
Thanks for pointing that out, I didn't even realize last night how weak of a selling point this is, even.
Earlier quoted context omitted.
I have just recently been looking into this. What would you normally reach for when doing templating?
HTML-based templating is toxic to a codebase, especially django templating. It is untyped, impossible to compile and trust, and it's horrible to maintain. Use React and JSX (TSX, to be more specific). NextJS does good quality SSR, use that if you want an app that is also usable without JS. Anybody not in that ecosystem /right now/ is going to be lagging behind by so much in velocity and capability, and will get eaten…
Earlier quoted context omitted.
HTML-based templating is toxic to a codebase, especially django templating. It is untyped, impossible to compile and trust, and it's horrible to maintain. Use React and JSX (TSX, to be more specific). NextJS does good quality SSR, use that if you want an app that is also usable without JS. Anybody not in that ecosystem /right now/ is going to be lagging behind by so much in velocity and capability, and will get eaten…
This simply isn't true. I see the velocity, but high magnitude doesn't mean that you're going the right direction.