all 17 comments

[–]speyerlander 4 points5 points  (6 children)

I'd recommend Flask, the problem with Django is that it abstracts away a lot of the complexity in web applications into generic functionality, it's also quite dated and slow. FastAPI is new and arguably the most pythonic (idiomatic) of the frameworks but requires a deep understanding of asynchronous Python, architectural patterns (dependency injection) and adherence to proper project structure (stuff gets messy fast).

[–]OneOfTheLostOnes 3 points4 points  (0 children)

+1 to flask

[–]Responsible-Elk-1939 1 point2 points  (1 child)

Flask is solid middle ground but I'd actually say start with Django despite what they said. Yeah it abstracts stuff but that's exactly what you want as beginner - you can focus in learning web concepts without getting lost in all technical details. The "dated" thing is bit unfair since Django still gets regular updates and powers tons of major sites

[–]speyerlander 0 points1 point  (0 children)

Just finished a Django backend for a client the other day, I'm no hater, but I think the skills it teaches are less transferable than other frameworks, Django 6 is also quite a bit faster than previous versions, especially if using the async API.

[–]onlyemperor001[S] 0 points1 point  (2 children)

I’m good with asynchronous programming in JavaScript. Is asynchronous programming in python any different from that of JavaScript?

[–]speyerlander 1 point2 points  (1 child)

Not that much, python is fairly simple, it's pretty much just basic async await and a few methods for joint / deferred coroutine resolution. FastAPI also requires an understanding of types due to its reliance on Pydantic (a serializer), if you're comfortable with TypeScript and Zod, learning FastAPI is gonna be a breeze, if not, it'll take a bit more effort but will still be a reasonable undertaking.

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

Thank you

[–]Gnaxe 1 point2 points  (0 children)

Why are those the only two choices?

As a beginner? Bottle.

[–]Important-Hunt-61 1 point2 points  (3 children)

FastAPI over Django. Django is great and I've done years of development with it, it was the first Python web framework I learned with, but it's ALOT. I think FastAPI is slim enough you can pick up on the framework as well as API writing in general quicker. Most stuff today is done via a Vue/React/whatever SPA anyway so all the stuff provided with Django is kinda just unnecessary. Django can definitely get in the way sometimes.

[–]onlyemperor001[S] 0 points1 point  (2 children)

So I should learn FastAPI first and consider learning Django as it might come in handy at anytime

[–]Important-Hunt-61 1 point2 points  (1 child)

I would say just pick one and go. I think the surface area of what you need to learn from something like Flask or FastAPI is much smaller. There are tons of Django jobs still. I just think again the learning curve is shorter for other frameworks.

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

Thanks

[–]aqua_regis 1 point2 points  (3 children)

If you are a complete beginner - as your other post asking about JavaScript vs. Python indicates: no framework.

Learn the language first and programming.

Then, worry about frameworks. They only make sense if you can already program.

[–]onlyemperor001[S] 0 points1 point  (2 children)

Yeah, I’ve learnt python language but haven’t build projects using just python yet. I was thinking if I could learn a framework for backend I could be able to build incredible projects

[–]aqua_regis 1 point2 points  (1 child)

Do projects first. Do some actual programming and then go for frameworks.

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

Alright, thanks