Hacker News new | ask | show | jobs
by zius 2588 days ago
Django abstracts away a bit too much, if you ask me. For a simple REST API it's complete overkill. I prefer Flask or Falcon[0], in which you don't just get better performance[1] but also a lower level of control.

[0] https://falconframework.org/

[1] https://klen.github.io/py-frameworks-bench/ or https://github.com/the-benchmarker/web-frameworks

3 comments

Why exactly do you want a lower level of control?

You want the complete opposite; have as many problems solved for you already with battle-tested ways to break out of the happy path when you need to.

Every sufficiently large Flask app becomes a half-assed reinvention of half of Django, except without the hundreds of thousands of eyeballs and man-centuries of bug fixing.

I agree with your parent. When I started with (Python) webdev some years ago I picked Flask, but nowadays I use Django, as it has superb documentation and useful things built-in. In particular I miss the user-management, authentication and authorization in Flask.

Personally I consider Django without any additional apps less complex than Flask with apps (or "plugins" in Flask jargon) to handle basic stuff like auth.

If performance is a concern, both of them are insufficient and I would rather pick another language like Rust, Go or even Java.

I started with Flask, moved to Django, and now at work am back on Flask. It all depends on what you are building; if you are going to need some ORM, standard auth, etc, Django is a no brainer. However if you are going to be building out much of your own idiosyncratic architecture, Flask gets out of your way and avoids including lots of things you don't need.

For performance, we are building some parts of our system with Clojure. It feels extremely well suited, albeit with some initial learning curve.

How are you implementing REST using Faclon if I might ask ? fully custom ? or is there anything like DRF hanging around ?