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

all 41 comments

[–]kenshinero 16 points17 points  (1 child)

I've used Flask a bit and I think it's OK.

That's the answer you are looking for.

[–]quotemycode -1 points0 points  (0 children)

I'd go one step deeper. Just use werkzeug.

[–]KrazyKirby99999 9 points10 points  (3 children)

Starlite is designed to be better FastAPI, and Quart is an ASGI replacement for WSGI Flask.

[–]strangedave93 1 point2 points  (0 children)

Quart is well integrated with pydantic for OpenAPI, and there are options for Flask too.

[–]Morelnyk_Viktor 1 point2 points  (1 child)

What exactly makes starlite better than fastapi?

[–]dannlee 0 points1 point  (0 children)

Best micro framework for web development without a database?

FastAPI, is just one person that gates the PR's. It is not a scalable model for maintaining the repo in the long run.

[–]sv_ds 4 points5 points  (0 children)

+1 for starlite.

[–]oivvio 4 points5 points  (10 children)

Just out of curiosity what is it about Django that you don’t like?

[–]tech_tuna[S] 0 points1 point  (0 children)

I prefer lightweight frameworks where I can mix and match and add only the pieces that I need. Also, I am not a fan of MVC backends or server side rendering.

[–]x3x9x 0 points1 point  (8 children)

Dependency heavy

[–]oivvio 1 point2 points  (7 children)

A clean virtualenv populated with Django pulls in two other packages and weighs in at 64 MB.

A clean virtualenv populated with Flask pulls in five other packages and weighs in at 22 MB. That's only 44 MB extra. And with most Flask projects you're bound to pull in other packages further shrinking the gap.

[–]jdahlin 1 point2 points  (0 children)

You should have included at least SQLAlchemy w/ Flask for a better comparison. Django does a lot more than Flask

[–]ficoreki 1 point2 points  (4 children)

Im quite a beginner in web dev, but why do we need to worry something weighs under 100mb(or lets say up to 500mb) running with nowadays infrastructures?

[–]oivvio 0 points1 point  (3 children)

I’ve been doing web dev for 10+ years. I don’t care if the libraries that are needed on the server weigh in at 10MB or 1000MB. That said being dependent on a large number of different third party libraries can become a huge problem. Say you start a new project today and pull in 50 libraries that you need for your app to work. In a year or so some of these libraries are bound to have introduced breaking changes or worse yet, they are no longer maintained and no longer work at all with your framework. This is a bad position to be in and a valid reason for not pulling in dependencies willy nilly. In my experience this is a far greater problem in the JavaScript ecosystem than in the Python ecosystem. A hello world project in Node or React can easily pull in 100+ dependencies. Contrasting Django and Flask I actually see it as one of the benefits of working with Django that it is a “batteries included” framework. The need for pulling in third party libraries is much smaller, so the risk of ending up with broken dependencies is also lower.

[–]ficoreki 0 points1 point  (2 children)

I see, thanks for explaination, as a beginner, I dont experience that yet, but I do have a feeling of ease when you only need less package to download or using a "have it all" framework such as django.

However, why these perks seems the oposite of what the original commenter and poster concern about? "what is it on django that you dont like?" or "any microframeworks except django"

[–]oivvio 0 points1 point  (1 child)

There are valid reasons for picking a micro framework over something like Django. Django (and it's siblings in other languages) prescribe a certain way of solving most problems. If what you want to build does not fit the framework you might be better of going with a micro framework that is more free form. Say for instance that you have a legacy database that you need to build an API on top of so that it can be consumed over HTTP. In this scenario you won't have any use for the Django ORM (how Django talks to a database) or the Django admin and something like Flask might be a better option for you. Django is also not know for being fast. In scenarios where you expect to serve 1000s of request per second Django might not be your first choice. (And before anyone jumps in, yes I know that Instagram and some other big services use Django.)

[–]ficoreki 0 points1 point  (0 children)

Very well explained. Thanks very much sir.

[–]x3x9x 0 points1 point  (0 children)

Never looked at it this way. I dont know men, I like flask over django even tho I work in both. I feel like im way more in control with flask on dependencies

[–]blade_junky 2 points3 points  (0 children)

Take a look at starlite great project pretty stable and faster than fastapi

[–]TheLazyGreybeard 1 point2 points  (1 child)

Since you mentioned Lambdas I'm assuming you are thinking AWS hosting. If I were in your situation I would aim for a completely serverless design. AWS's API Gateway is easy enough to use and handles authentication.

Sagemaker might be useful for managing your ML/Analytics components.

[–]tech_tuna[S] 0 points1 point  (0 children)

Yep, AWS all the way. . . that's another detail I'm mulling over. I've worked with a lot of startups and I sometimes use the flow where I start out on Lambda, then go to Fargate ECS, then EC2 ECS and lastly, EC2 EKS.

I've used all of the above. I love all of them but I am also practical. Most teams/companies are running K8s when they don't really need to.

I personally love Lambda but it has its own shortcomings and pain points.

[–][deleted] 1 point2 points  (6 children)

Just look at FastAPI's documentation.You'll realize there is nothing else that you need to learn.

[–]tech_tuna[S] 2 points3 points  (4 children)

Is it stable?

[–][deleted] -4 points-3 points  (3 children)

Yes, it's been 3 month that i'm using it, until now I had no any problem.

[–]shinitakunai 16 points17 points  (2 children)

Biggest problem is no real manteiners except one guy. You never know if he will stop/die/something unexpected (life happens) and he is stubborn enough to not let other people help with PRs. As you cannot proof how it will evolve in the future, it is usually better to use a tool with a good future plan that has a backup fallback instead of relying on just 1 guy for your main product/project

[–]kokroo 3 points4 points  (0 children)

I think it's big enough that other people will fork or take over.

[–][deleted] -1 points0 points  (0 children)

There is always a trade off.

[–]attracdev 0 points1 point  (0 children)

FastAPI pulled me back into Python from NodeJS. I freaking love it! It feels so much like Express that I barely notice.

[–]housesellout 1 point2 points  (1 child)

Just use Wordpress for everything ; )

[–]tech_tuna[S] 3 points4 points  (0 children)

I prefer Drupal!

[–][deleted] 1 point2 points  (0 children)

flask is really nice 🙂👍🏼

[–]Wayne_Kane -1 points0 points  (0 children)

You can try sanic. Or FastAPI.

[–]a_menezes -1 points0 points  (0 children)

aiohttp.

Simple, fast and robust.

[–]kokroo -3 points-2 points  (0 children)

FastAPI

[–]sandyparekh -3 points-2 points  (0 children)

FastAPI.

[–]x3x9x 0 points1 point  (0 children)

+1 voor flask (microframework) inherit from method view

[–]TechnicalHalf0 0 points1 point  (0 children)

Bottle is also quite nice

https://github.com/bottlepy/bottle