Live data from Hacker News

BlackSheep: Fast ASGI web framework for Python

github.com

21–30 of 49 posts

Re: BlackSheep: Fast ASGI web framework for Python

#21

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.

Re: BlackSheep: Fast ASGI web framework for Python

#22

What is the plus value vs a 'classical' equivalent like FastAPI ?

So as far as I can tell, this is basically a more modern Flask. It pulls in design lessons from FastAPI, but it's still more batteries included such as templating (jinja2) and authentication. Neat, but tbh I am very bearish on Python's future beyond APIs - templating html in Python is a terrible idea for anything larger than a hobby site, when you can have an API-first app with a React+Typescript frontend. And if you…

[deleted]

Re: BlackSheep: Fast ASGI web framework for Python

#23
post #20

I’m worried about the psychological health of people that make stuff like this. Why? Nobody uses these frameworks unless paid, you need an actual team of people to maintain it.

It's for the cv and getting hired through the tech stack. Most hope to become next fastapi

Re: BlackSheep: Fast ASGI web framework for Python

#24
post #16

Earlier quoted context omitted.

So as far as I can tell, this is basically a more modern Flask. It pulls in design lessons from FastAPI, but it's still more batteries included such as templating (jinja2) and authentication. Neat, but tbh I am very bearish on Python's future beyond APIs - templating html in Python is a terrible idea for anything larger than a hobby site, when you can have an API-first app with a React+Typescript frontend. And if you…

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 by competition.

Re: BlackSheep: Fast ASGI web framework for Python

#25

Earlier quoted context omitted.

So as far as I can tell, this is basically a more modern Flask. It pulls in design lessons from FastAPI, but it's still more batteries included such as templating (jinja2) and authentication. Neat, but tbh I am very bearish on Python's future beyond APIs - templating html in Python is a terrible idea for anything larger than a hobby site, when you can have an API-first app with a React+Typescript frontend. And if you…

For Django, there's also django-bridge. This lets you build React apps that are backed by Django views/routing. You can also use Django's built-in authentication and forms which isn't easy with APIs.

Yes, auth between Django and a PWA is not a solved problem. It seems people just give up and go the hosted auth route or something.

But it's also really not that difficult. Auth just takes a lot of practice for people to grok so most people don't want to touch it.

I'll open source something once we're done solving the problem cleanly at my company.

Re: BlackSheep: Fast ASGI web framework for Python

#27

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.

Re: BlackSheep: Fast ASGI web framework for Python

#28
post #20

I’m worried about the psychological health of people that make stuff like this. Why? Nobody uses these frameworks unless paid, you need an actual team of people to maintain it.

Well yeah, and there is no support. I've had this issue open for months:

https://github.com/Neoteroi/essentials-openapi/issues/47

Re: BlackSheep: Fast ASGI web framework for Python

#29
post #20

I’m worried about the psychological health of people that make stuff like this. Why? Nobody uses these frameworks unless paid, you need an actual team of people to maintain it.

...sometimes people build things for fun, or as proofs of concept for iterative improvement on existing tools (which can then go on to inspire changes in existing and new mainline tools).

What does that have to do with (negative) mental health?

Re: BlackSheep: Fast ASGI web framework for Python

#30

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.

It has dependency injection
Post reply on HN