3 ms·
I would love to know what HN's python folks are using for new projects these days. I've looked at FastAPI before and it has some nice features like asyncio and
by iooi 6y ago
I would love to know what HN's python folks are using for new projects these days.
I've looked at FastAPI before and it has some nice features like asyncio and pydantic integrations. But it doesn't have any official users library, and ideally a framework should have that available.
I've started looking outside of the Python ecosystem since it feels like there's nothing new and exciting come out of there. I've played around a bit with NestJS and it's amazing how far the TypeScript ecosystem has come.
It's also crazy that SQLAlchemy doesn't have typing support still, so TypeORM looks really appealing.
- gmfawcett 6y agoI disagree that FastAPI should have an official users library. A popular third-party one would be fine, but it doesn't belong in the core project.
- iooi 6y agoI can see that, I think what I meant was "de facto" (think flask-user) library instead of "official".
- eddsalkield 6y agoI'd recommend you check out FastAPI-Users if you haven't already: https://github.com/frankie567/fastapi-users https://github.com/frankie567/fastapi-users It provides a users framework with OAuth2 integration, support for different ORM backends, and routes for authentication, verification, etc. Full disclosure: I am a contributor to this project.
- alchermd 6y agoI still use Django to this day, both for monolithic SSRs and REST APIs. All the batteries it comes with are perfect for the common use case, and the small "bubble" around it (ex: DRF) is as good as it gets IMO. The tooling around REST APIs are lacking compared to Flask and FastAPI, but wrangling what's available (drf-yasg, oauth2lib) to suit my needs is better than migrating to another framework I think.
- konschubert 6y agoSame here. When I want to get a new project of the ground, I use Django. This partially due to the batteries included, partially because I am very familiar with it. On more mature projects, at the stage where I really start splitting services into their own hosts, I switch to something else. Django's batteries are no longer useful at this stage, since e.g. auth is it's own service now.
- boxed 6y agoDjango plus django-fastdev plus iommi. Full disclosure: I'm the author of django-fastdev and co-author of iommi.
- __mp 6y agoWe're using FastAPI for the backend. We then use the OpenAPI.json exposed by the documentation endpoint to generate API bindings for Typescript.
- tiangolo 6y agoI also looked at NestJS before creating FastAPI, and it certainly inspired ideas in FastAPI (also TypeScript in general), you can read more about that here: https://fastapi.tiangolo.com/alternatives/ https://fastapi.tiangolo.com/alternatives/ About ORM with types, yeah, I also want an ORM based on standard type annotations. So I started playing with mixing SQLAlchemy and Pydantic, and I have some unfinished lab experiment with it. I haven't found the time to finish it, but hopefully I'll find it soon.
- nickjj 6y agoI still happily use Flask with mostly Jinja rendered templates. With things like Hotwire and htmx you can build very nice feeling apps without going all-in with an API back-end and JS front-end. I released https://github.com/nickjj/docker-flask-example https://github.com/nickjj/docker-flask-example as a starter kit for what I use in new projects. It wires up things like SQLAlchemy, Celery, Flask, gunicorn, Webpack, etc. with Docker. It also comes with CLI extensions for digesting / md5 tagging assets with optional CDN support using Flask-Static-Digest, database migrations / seeding with Flask-DB and more. If I ever need to create API endpoints I combine Flask-Classful (routing), Marshmallow (serialization / validation) and Flask-JWT-Extended (authentication). I've written about this combo at: https://nickjanetakis.com/blog/flask-libraries-for-building-awesome-real-world-restful-apis https://nickjanetakis.com/blog/flask-libraries-for-building-...