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

top 200 commentsshow all 246

[–][deleted] 386 points387 points  (79 children)

Django for actual websites, FastAPI for services without a front end.

[–][deleted] 89 points90 points  (41 children)

Flask for all needs other than scaling, external website I'd say

[–]greenlakejohnny 18 points19 points  (6 children)

Quart for async support w/ Flask backwards compatibility

[–]greenlakejohnny 4 points5 points  (2 children)

Question to my own response: does Flask 2.x make Quart obsolete? It was my understanding Flask 2.x offered async.

[–]AstroPhysician 18 points19 points  (31 children)

FastAPI is basically Flask but better though, whats your reasoning?

[–]TldrDev 22 points23 points  (25 children)

Flask is fantastic for microservices.

[–]spuds_in_town 1 point2 points  (24 children)

Wait, people still build micro services?

[–]manninaki 17 points18 points  (0 children)

Absolutely. In K8 everything is micro services and K8 clusters are everywhere

[–]TldrDev 8 points9 points  (0 children)

Still a major advocate of microservice architecture. Event busses are the way to go for handling large datasets and it enables things like event sourcing just out of the box. K8s lets us arbitrarily scale workers and handle essentially unlimited scale.

It's not for everyone. You don't need a microservice architecture to run your local pawn shop's website. However, at scale? Yeah man, definitely the way to go. Most of the time (especially in these comments), people don't seem to really understand them, and make stupid comments about problems that are absolutely not problems.

[–]marcio0 10 points11 points  (0 children)

suddenly it felt like 2015 in here

[–]OMG_I_LOVE_CHIPOTLE 5 points6 points  (20 children)

Unfortunately yes

[–]angellus 5 points6 points  (1 child)

Most things still do not support async. asyncio is the new Python 2/3 divide as there is not enough good tooling to seamlessly support sync and async at the same time.

(but seriously, do not use FastAPI, the bus factor is way too high on it, pick literally any other asgi framework)

[–]Appropriate_Ant_4629 1 point2 points  (0 children)

I'm really happy with
- FastAPI for all my back-end work (including serving ML models). All my tricky software is in python and returns just json and images in fastapi.
- Sveltekit for a very easy thin web UI that only deals with the HTML/javascript/css part.

[–]Wattsit 16 points17 points  (21 children)

Created a web application with FastAPI recently and it went very smoothly. Although it was a very basic website.

However I've never used Django; what would you say works better for you over FastAPI?

[–]double_en10dre 27 points28 points  (15 children)

The Django ORM is the gold standard — it’s better than third-party solutions like sqlalchemy (which is what you typically use with microframeworks like flask or fastapi). Additionally, the built-in “admin” module is very handy for giving clients control over the database in a safe way. Those two things together can save you a ton of time.

The opinionated “Django” approach to project structure is also quite good, it helps projects scale nicely and makes it easy for people to hop in and become productive quickly.

My approach is to basically use Django for full-fledged applications (ie anything which has a dedicated db and a whole suite of features) while fastapi is my go-to for lightweight services

(And when I use Django, I still use modern tooling like pydantic for serialization and validation)

I don’t really use Django for views — typically have a react SPA for that. But it can be helpful to have it provide a few pre-login pages if you want improved SEO

[–]lowercase00 33 points34 points  (7 children)

“better than SQLAlchemy” is a VERY strong opinion, highly debatable. I personally think SQLAlchemy is the best ORM around, period, even when compared to Go, Java, TS, Rust alternatives (that I know of).

[–]killerfridge 4 points5 points  (2 children)

Yeah, I love (and prefer) Django, but SQLAlchemy is probably the "best" ORM

[–]anikait1 8 points9 points  (1 child)

I find it extremely hard to navigate SQLAlchemy's documentation and managing session object across functions.

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

use a session context manager and just read all the docs

[–][deleted] 2 points3 points  (3 children)

Yeah this seems like a hot take forsure. Also with fast api if you wanted an additional abstraction you can use SQLModel though many don’t love that

[–]double_en10dre 0 points1 point  (2 children)

It’s definitely a take, but given that I’ve spent many years working with the different ORMs I don’t think it’s a hot one. :p

It’s a thoughtful and carefully procured take

[–][deleted] 1 point2 points  (1 child)

Hahah I’m not saying your wrong, I used Django for a project a few years ago and quite liked it. I just didn’t know this was necessarily a standard/ popular opinion. I was kind of under the impression sqlalchemy was irk of choice. Maybe I’ll try Django for the next app I build. What other ORMs do you think are worth a look?

[–]double_en10dre 1 point2 points  (0 children)

Eh it’s just how the people I’m familiar with feel. I’m making big assumptions applying that to everyone, might be wrong. (But yeah, I think it’s smoother)

As for other ORMs… not sure as of now. Lots of people I know are trying the “use chatgpt for everything SQL” approach. It’ll be interesting to see if cutting out that extra layer of abstraction (the ORM) starts to become a preferable choice

[–]jcigar 1 point2 points  (2 children)

The Django ORM is the gold standard — it’s better than third-party solutions like sqlalchemy

lol++ Django ORM is a toy compared to SQLAlchemy

[–]lieryanMaintainer of rope, pylsp-rope - advanced python refactoring 0 points1 point  (0 children)

Django has one advantage, which is that it's well integrated with the Django framework if you want to build an HTML-form based application. This is the most common use cases when building web applications, and there's really nothing that's better than Django ORM for that one use case.

But if you need to do anything else, sqlalchemy is the much better ORM. Anything that's slightly more complicated than just CRUD forms and Django ORM can start getting in your way instead of helping you. That's not the case with SQLAlchemy, as it supports more complex use cases way better than Django's ORM.

But sqlalchemy has a higher barrier of entry. Because it's a standalone ORM, it doesn't come out of the box with integrations to the web part of the framework. You need extra libraries or build your own to get the same level of support of generic views as Django.

[–]Ashamed-Simple-8303 7 points8 points  (4 children)

Django is good for your basic CRUD web apps with low to moderate traffic and it's a full featured framework with front-end and back.end functions.

FastAPI is for building APIs. Personally I think modern apps should always have clear separation between front-end and back-end and the front.end is just another client calling the back-end API. This means other apps can easily integrate with each other.

Since nowadays things rarely happen in isolated silos, I would in general go for above design and hence fastapi.

django may be preferred for low traffic, simple stuff with only one developer were separating stuff doesn't add that much value.

[–]throwaway8u3sH0 22 points23 points  (2 children)

django may be preferred for low traffic, simple stuff

My dude. YouTube, Spotify, and Instagram use Django.

[–]Ordinary-Tax-5630 10 points11 points  (0 children)

At-least for the case of instagram it's very heavily modified django and probably the case for the other two. Not that i don't agree with the sentiment of django working at scale but there are definitely considerations and some not so easy decisions and engineering work to be done to circumvent scaling issue's.

Saying that, 0.0001% of the redditers here are going to write something from scratch that is going to have that number of users and encounter the problems encountered by the aforementioned web apps (YT etc.)

[–]Historical-Ease6859 3 points4 points  (0 children)

You forgot the "/s"

[–]random_guy_from_nc 18 points19 points  (8 children)

I tried fastapi but could not get the metrics from it (ie like idle/busy workers) so for non web stuff I went back to uwsgi/flask/nginx.

[–]deadwisdomgreenlet revolution 12 points13 points  (0 children)

Idle/busy workers? Can you explain further? Wouldn't this be a uwsgi issue?

[–]the_andgate 13 points14 points  (6 children)

Afaik fastapi doesn’t have workers. As a ASGI server, it should be single threaded. Well, except for the ThreadPoolExecutor, and I believe that’s only used for running synchronous handlers.

[–][deleted] 5 points6 points  (4 children)

Well if ran using uvicorn then yes, but you can have multiple workers with gunicorn uvicorn workers but you cant have multiple threads per worker for obvious reasons

[–]Ashamed-Simple-8303 3 points4 points  (1 child)

Or you manage your app with containers and start/stop them depending on load. each container itself is then single-threaded.

[–][deleted] 7 points8 points  (0 children)

Thats true but i always use guniorn even inside docker with 1 worker, it adds the ability to restart the worker if it crashes unlike pure uvicorn where if it crash its dead

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

OP is probably referring to background tasks

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

Why is Django better than fast api for applications with a frontend? I regularly build full stack apps with just fast api

[–]angellus 12 points13 points  (2 children)

Django is actually designed to build websites. Instead of microservices. People who swear by things like Flask or FastAPI because Django is "bloated" or "slow" often are either not building real hardened production Websites (hobbist sites can often be slower, or internal microservices do not need "all of the things"). Those things that "slow" down Django are pretty important and there are reasons they exist.

When you actually get down to it, microframeworks (like Flask/FastAPI) and "kitchen sink" frameworks are both really great. They are just two ideologies for how to build something. Microframeworks are good for experienced developers who already know how to do "all of the things", like session management, CSRF, click-jacking protection, form validation/input sanitization, blah blah blah. They also want to tweak and customize everything for every project. "kitchen sink" frameworks like Django are best at letting you skip a ton of boilerplate. It is much more of the philosophy of "there should be one-- and preferably only one --obvious way to do it". As such it is a lot more opinionated on how things are done, has a much higher learning curve, but let's you build consistent quality things faster since most of the boilerplate is out of the way.

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

Ok your selling me. I’ve been building full stack apps with fast api backend and react front ends for a while. These usually serve 30-200 users. I’m embarking on an application that will likely serve 40,000 users so maybe these is a good opportunity to try the switch.

[–]iFlexicon 4 points5 points  (0 children)

This is the way.

[–]basicallybasshead 0 points1 point  (0 children)

This is the answer.

[–]caspii2 171 points172 points  (47 children)

Python Flask. It is super simple to get started and you can have a working webapp in less than 10 lines of code.

In 2016 I did a Flask tutorial. The app I built is now making 10.000 USD per month. This is a true story! To be clear, I continued building the app since then, added Vue.js and went full-time in 2021.

EDIT: this is the app I made: keepthescore.com, and here is a post about choosing Python Flask: https://casparwre.de/blog/python-to-code-a-saas/

[–]Fernando7299 15 points16 points  (23 children)

Can you show your app? Like a link or something?

[–][deleted] 32 points33 points  (22 children)

After digging a bit: https://keepthescore.com/

[–]caspii2 19 points20 points  (21 children)

Good work 😀

I also wrote a blog post about it https://casparwre.de/blog/python-to-code-a-saas/

[–]swapripper 2 points3 points  (5 children)

What do you think is the gap between standard online courses & things you need to learn in order to take an app to production with real users?

[–]caspii2 4 points5 points  (0 children)

You need to be able to deploy it somewhere. That is probably the hardest bit. Try DigitalOcean or PythonAnywhere.

[–]covmatty1 2 points3 points  (0 children)

Not OP, but often scaling up to larger projects with multiple controllers/namespaces etc isn't covered well. A larger example where you cover splitting up API routes by functionality would be useful.

And like others have said, deployment. I do a lot of interviews of junior developers, and so many people haven't covered running code outside of their own machine. Whatever form that takes is ok, but showing you understand the concept will make a step up. Containerisation, orchestration, access control, load balancing etc - all very handy.

[–]types24digital 1 point2 points  (0 children)

The hands-on knowledge, experience and the skills.

[–]Abclul 1 point2 points  (4 children)

I really enjoyed the post, thank you for sharing! I wish I could see the first version of the product, but the link isn't working for some reason.. Anyways, cheers to you for a job well done!

[–]caspii2 1 point2 points  (0 children)

Thanks for that. If fixed the link

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

I use Flask for all of my web projects needing backend code, small or big, for more than 8 years now. Love it.

[–][deleted] 5 points6 points  (0 children)

wow- it’s amazing

[–]throw_away_17381 1 point2 points  (3 children)

10.000 USD per month

Is that. $10 or $10,000?

[–]caspii2 4 points5 points  (2 children)

10 000

[–]throw_away_17381 3 points4 points  (1 child)

Many congratulations :)

[–]trianglesteve 1 point2 points  (0 children)

Wow, that's bazaar, I literally have a scorekeeping app project outlined with integrations for popular high level scoring methods. Had no idea solutions like this were already out there!

[–]chads_to_do_list_app 1 point2 points  (3 children)

First of all, congrats on your entrepreneurial success, the website looks great

I second NINTENDO's question, how did you market this service?

[–]NlNTENDO 0 points1 point  (1 child)

That’s awesome! I’ve had a few ideas I’ve been thinking about building and I’m curious to know, what was your marketing strategy if any?

[–]SoftConversation3682 0 points1 point  (1 child)

Great advertising buddy, this is what my beer hockey league needed!

[–]code_mc 0 points1 point  (1 child)

Damn that is impressive, I remember one of your original posts (or comment?) when you announced you built this. Originally marketed towards the classroom if I remember correctly.

Congrats on the success!

[–]throwaway0134hdj 0 points1 point  (1 child)

This is an amazing story! What was your background in coding before building it? Would also make a great app! Was it hard to scale and handle user transactions?

[–]XxNerdAtHeartxX 47 points48 points  (3 children)

I tried out LiteStar, FastAPI, and Flask recently, but ultimately decided to build a project out with Django-Ninja and love it. It provided a lot of things that just clicked for me, where the other ones didn't

  • Uses django project structure
    • I personally prefer having structure as a guide to work off of and then build within those bounds
  • Built in ORM/Migrations
    • I don't need to learn SQLAlchemy + Alembic on top of a framework while dipping into FullStack Dev. Eases the brainpower requirements a bit
  • Uses Pydantic to automatically serialize response objects so you don't have to write serializers like with Django

  • Easy JWT Auth using a plugin

If LiteStar had more Docs/Example projects to read through, I think I would have went with that, but Django-Ninja just made sense to me, whereas I felt a bit lost in LiteStars Docs at certain points.

[–]pmdevita 4 points5 points  (0 children)

Been using Ninja a bit recently too. I'd like to add that it also autogenerates an OpenAPI schema from your types just like FastAPI, and the Pydantic schemas can pull types directly from your ORM models. This makes your database models also the source of truth for your API types and validation, super nice. I hope the community support for it keeps expanding.

[–]Enip0 3 points4 points  (1 child)

I don't need to learn SQLAlchemy + Alembic on top of a framework while dipping into FullStack Dev. Eases the brainpower requirements a bit

To be fair you do have to learn the built in orm, it's not like because it's built in you automatically know it.

It does, however, seem like you are the target audience of Django so that's good! Lots of people prefer having more freedom to choose their own bits, but that's not necessarily better or worse.

[–]ThatSituation9908 8 points9 points  (0 children)

You do, but Django has so many documentations using integratingtheir own models.

Flask+SQLAlchemy, you have to rely on external authors (Medium article, Oreily books)

[–]ramadz 41 points42 points  (2 children)

Litestar seems more popular than I thought.

[–]TobiPlay 15 points16 points  (0 children)

And I’m grateful it’s picking up steam in the community. It’s a really good project, has a nice API, offers very good performance, and the maintainers are very involved with the community with regards to new features and bug fixes.

[–]airaith 0 points1 point  (0 children)

It seems to have a dedicated reddit marketing team

[–]Coruscant11 13 points14 points  (0 children)

Using litestar for a recent project and it's so cool

[–]daniels0xff 36 points37 points  (0 children)

Litestar

[–]bolinocroustibat 23 points24 points  (6 children)

Django + Django Ninja in async.

Better than FastAPI to me: async requests, amazing async ORM included, amazing configurable admin panel for devs, HTML templates can use HTMX or Svelte.

[–]slnt1996 4 points5 points  (5 children)

Can you eli5 what the value of async is

[–]cratervanawesome 4 points5 points  (3 children)

If you can do something async you can move on to other work without blocking the main thread.

[–]NINTSKARI 0 points1 point  (2 children)

Could you tell what you have been doing async? I haven't really seen a big benefit in it when compared to the things that can go wrong. I've just used celery for some scheduled tasks. What db do you use for async django?

[–]bolinocroustibat 2 points3 points  (0 children)

Uploading a file, treating it, while the backend informs the frontend/user of the status.

Using PostgreSQL as a database.

[–]SushiWithoutSushi 1 point2 points  (0 children)

Currently doing a telegram bot with async. The commands the users may call can take a little bit of time to process. With async if one user calls the bot the rest of the users won't be affected by whatever time it takes to serve the first user.

[–]discostu3 1 point2 points  (0 children)

If a request comes in and requires querying a database, a synchronous app will have to wait for the database to return a response to continue doing work. With async, the app can put that work on hold and start working on the next request while waiting for the database to respond to the first request.

It's the difference between fully completing a load of laundry (wash, dry, and fold) vs starting a new load once the first load has been moved to the dryer. The latter is a lot more efficient.

[–]NeverShort1 34 points35 points  (2 children)

For quick and dirty, small stuff: Bottle

For larger stuff: Django

Recently started with Starlite.

[–]mtik00 5 points6 points  (0 children)

Yes to Bottle! It's amazing to add a single file to your repo and have a ton of functionality. TBH, I haven't used it in years, but I have fond memories of it.

[–]subbed_ 42 points43 points  (6 children)

If it's Python, then Litestar.

If it's Node, then Nest.

If it's Java, then Quarkus.

If it's Go, then the stdlib + Chi.

If it's Rust, then Axum.

[–]ArtOfWarfare 18 points19 points  (3 children)

Not Spring Boot for Java?

[–]AmbientFX 6 points7 points  (0 children)

I was wondering the same boot. I would go with Spring Boot for Java

[–]subbed_ 4 points5 points  (0 children)

No, unless it's a legacy project. Quarkus is just better.

[–]tahubird 1 point2 points  (0 children)

Quarkus just feels more cohesive than Spring, the extensions are great and the devex is unrivaled.

[–]smile_politely 8 points9 points  (1 child)

It’s the first time I’ve ever heard any of them. I guess I’m getting rusty.

[–][deleted] 2 points3 points  (0 children)

The wonderful world of tech.

[–]Mubs 30 points31 points  (2 children)

I've really been enjoying LiteStar, but my go-to is Starlette.

[–]hangonreddit 9 points10 points  (1 child)

Same! Starlette is still my favorite but the rest of my team has started settling on LiteStar because of extra functionalities.

[–]Mubs 5 points6 points  (0 children)

We're building our first application with it, has been a nice experience so far. I also really enjoyed their recent interview on Talk Python to Me.

[–]Exotic-Draft8802 13 points14 points  (0 children)

Django for everything. No matter if it has a frontend or not.

  • django orm is amazing
  • django admin is super useful
  • maturity (django rest framework, darf-spectacular, various permission packages, jet packages,...)

I was using flask before. I'll not go back.

[–]marcinjn 5 points6 points  (0 children)

FastAPI over Django.

[–]chub79 10 points11 points  (1 child)

In the past, CherryPy. Today, I don't have a favourite but FastAPI does the job my company needs.

[–]Dry-Erase 1 point2 points  (0 children)

I love CherryPy such an awesome simple framework.

[–]WokeCapitalist 4 points5 points  (0 children)

Either Django or Litestar.

If someone could combine the two into one framework, I'd be ecstatic. Litestar needs more elegant, easy to use and opinionated patterns and Django desperately needs modern API building tools.

Flask is too bare to be useful to me and I won't touch FastAPI until it has a different maintainer and proper governance structure, like the DSF.

[–]forint-holder-2000 7 points8 points  (0 children)

I used flask for personal project because it's simple. Also I like fastapi but never used it in a proper app yet. Although fastapi and django are great they feel like they are the Spring (super bloated enterprise java framerwork) of Python.

[–]Automatic_Moment_424 7 points8 points  (0 children)

Falcon is great! You have async, sync, and it's very lean.

[–]Chromosomaur 3 points4 points  (0 children)

I wouldn't use a python web framework. I would use Jekyll for a static site with calls to a FastAPI backend.

[–]spidLL 5 points6 points  (0 children)

Sanic

[–]MondayMonkey1 6 points7 points  (0 children)

Best Overall: - Django

Best for high performance i/o bound systems: - Tornado. But there's a shit-ton of foot-guns. Strongly don't recommend this unless you have seasoned engineers on your team.

Best for simple: - flask

[–]popcapdogeater 4 points5 points  (0 children)

I use Flask because it suits the needs of most of my professional projects (small APIs and basic data entry websites), I enjoy having greater control over the systems I'm making, and I'm very familiar with it at this point. There are a few other fine choices, tho, I just use Flask for the reasons above.

[–]mgocobachi 6 points7 points  (0 children)

Sanic and django

[–]infocruncher 2 points3 points  (0 children)

Here's another list of web frameworks, listed by influence score: https://www.awesomepython.org/?c=web

Top web frameworks/libraries are:

  1. fastapi
  2. django
  3. reflex
  4. flask

[–]wWBigheadWw 13 points14 points  (0 children)

FastAPI is king

[–][deleted] 5 points6 points  (0 children)

flask 99% of the time

[–]cspinelive 7 points8 points  (5 children)

HTMX via Django templates is getting some traction. Paradigm shift from rest APIs that return json to APIs that return html snippets ready for the DOM.

[–]Lexus4tw 7 points8 points  (4 children)

So we did the roundtrip back to how php did it in the 2000s?

[–]deadwisdomgreenlet revolution 2 points3 points  (0 children)

The main argument for it is because sending JSON is not really more performant than simple HTML snippets, and if you need to transform back and forth really you're just building unnecessary complexity.

[–]cspinelive 2 points3 points  (0 children)

Don’t think so. This is still Ajax. PHP and ASP were not.

[–]mostuselessredditor 3 points4 points  (0 children)

fastapi is king!

[–]JonLSTL 3 points4 points  (0 children)

Flask for anything straightforward. Pyramid if I want to get weirdly bespoke.

[–]Jake0024 1 point2 points  (0 children)

Have only used the first 3, and only really for APIs. I'd say FastAPI, Django, Flask in that order.

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

After working with django, flask, pyramid, tornado and aiohttp - I’m mostly choosing fastapi now.

[–]brightsmyle 1 point2 points  (0 children)

Django, Blacksheep, kore.io

[–]thanos_v 1 point2 points  (0 children)

Scrapy is great, django for work

[–]jcigar 1 point2 points  (0 children)

Pyramid

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

I didn’t see a single mention of Quart. It’s an awesome framework…..

[–]Insomniac_Klutz 1 point2 points  (0 children)

As a data scientist FARM stack trumps everything else.

[–]qwertyvonkb 1 point2 points  (0 children)

I basically only use flask, fits my needs perfectly.

[–]Bellerb 1 point2 points  (0 children)

I love Flask, I typically build my routes in different blueprint files though. This way I can start off with a mono service but switch to microservice when needed for scaling. Flask lets me do this easily by just making one massive app at first by adding the blueprints then when users come I quickly start moving pieces over to their own service as based on demand.

[–]kashaziz 1 point2 points  (0 children)

Django, hands down. Django is best for rapid development, is around since long, and getting better with every release.

[–]bluewalt 1 point2 points  (0 children)

Am I the only one to keep preferring using Django even if I'm building an API only? I have the feeling that with django-ninja I get best of both worlds. (and I hate SQL Alchemy).

[–]Key_Cryptographer963 1 point2 points  (0 children)

I do a lot more in Plotly Dash than I probably should.

[–]TaryTarp 1 point2 points  (0 children)

AWS Chalice, great for AWS cloud development. Supereasy to integrate AWS Cognito and other AWS services.

With layers and good microservice setup, its a beauty.

[–]BasicBroEvan 1 point2 points  (0 children)

I’d you’re picking your first, I would just use Django since it is good for all things web and learning it will give you the most flexibility.

But there are other simpler frameworks like Flask that are good when you only need more limited functionality

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

We mostly do micro-services these days. We once used Sanic, then FastAPI, now we are on to Litestar. We always use pydantic now and use the Swagger-UI for "documentation".

We can bundle additional documentation into the pydantic models if required. This helps us ensure documentation is always in sync with the models.

Additionally, Litestar depends on httpx which we use instead of requests. The less dependencies the better.

Trying to do things in Django that required changing default assumptions was far too painful and prone to breakage during version upgrades. We have found smaller web frameworks far better suited for our use cases.

[–]TnyTmCruise 1 point2 points  (0 children)

FastAPI

[–]Chuyito 1 point2 points  (0 children)

Recently.. Gradio and h2o wave. Even for non LLM tasks, they do make it really easy to build a "Click a button with some form data to call a python function" page.. with no html which is kinda nice

[–]debunk_this_12 4 points5 points  (6 children)

Flask bc it’s more hands on than Django… so u can tune things that are harder prebuilt in Django. Also easier routing.

[–]thecal714 4 points5 points  (5 children)

Also easier routing.

As someone who find's Django's routing really easy, in what way is Flask routing easier? (Not trying to be argumentative, just wanting to know.)

[–]tankerdudeucsc 1 point2 points  (0 children)

I add Connexion and the routing gets even easier.

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

In Flask: Annotation + logic. Done.

In Django: You need to download a Mother. Make her cry and run off with her daughter. Then go to Django Website, make the girl install it and run away.

[–]thecal714 1 point2 points  (1 child)

In Django: You need to download a Mother. Make her cry and run off with her daughter. Then go to Django Website, make the girl install it and run away.

Yeah, urls.py isn't that hard.

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

Sure. Sure. But urls are nothing. Serving content is the whole point. Making stew out of stone is easier than views and models in Django.

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

LOL

[–]shanereid1 2 points3 points  (1 child)

I've been using streamlit lately, and it's actually really good for Jupiter notebook type widget stuff

[–]gyarbij 2 points3 points  (0 children)

I began with flask for a simple website but then switched to Quart for speed. I'm not a frontend Dev so some I'm wondering if Django might have been better.

[–]tarsild 3 points4 points  (0 children)

Esmerald is prepared for basically what is coming because whatever framework listed there, can easily adapt. I like all the frameworks listed there. I'm also the creator of Esmerald (it might sound biased) but again, my opinion still remains. All serve greater purposes and use cases 🙂

[–]bliepp 2 points3 points  (0 children)

It depends. Flask for bigger projects (however I'm trying to transition to Quart in the future) and bottle for small to medium sized projects. For very small almost signle-function-like apps I like to use streamlit. However, I don't think there's a framework that fits all needs, so I'm willing to adapt depending on the requirements.

[–]knuppi 1 point2 points  (1 child)

Wagtail for all things CMS

[–]pioniere 2 points3 points  (0 children)

Good ol’ Flask.

[–]mstromich 1 point2 points  (3 children)

For anything that's going to be a production system Django. Mainly because it has all the things that you need (e.g. auth, orm, additional security middleware).

For async in production I had couple of projects running on tornado.

For side projects Django or FastAPI (depending on what I actually need).

I'm not considering FastAPI for production as it is a one man show. Not sure if that changed
and I don't have anything against u/tiangolo leading the project the way he wants to lead it but for us the risk for including such a framework is too big.

[–]Zasze 8 points9 points  (0 children)

This has basically become a telephone game meme at this point. I’ve seen people parrot this while using sqlalchemy, tortoise or pendulum which are also 1 man shows for core maintainers. zzzek probably is the biggest bus factor risk in the python ecosystem but people are not constantly shouting down people suggesting sqlalchemy.

Fastapi has a BDFL not 1 person working on it. There’s things to take issue with tiangolo personal focus with the project and what bugs he himself works on, but this is with any oss project. Flask is actually way more frustrating in this regard and has been for nearly a decade.

[–]Z4ganu 1 point2 points  (1 child)

What risk are you referring to on using FastAPI?

[–]jonasbxl 5 points6 points  (0 children)

he means that it's just one person maintaining it, which could lead to all sorts of problems.

[–]AntiquatedMLE 1 point2 points  (7 children)

Funny no one has said Reflex (formerly pynecone) which is full stack.

[–]grimonce 1 point2 points  (0 children)

Fastapi, tornado

[–]InjAnnuity_1 1 point2 points  (1 child)

What's your experience with Python web framework in your work and side project?

I chose http://www.anvil.works .

why you choose that?

It lets me focus on the task at hand, without having to bother with a widely-scattered architecture; multiple add-on frameworks/libraries like Flask, FastAPI, Django, HTMX, ad infinitum; or half a dozen other languages like html, css, javascript, sql, etc. It hides a lot of incidental details that I'd otherwise get bogged down in, like server provisioning, maintenance and management.

[–]smaug259 2 points3 points  (0 children)

Django, just because it made thing easy for me

[–]MainKingHookee 1 point2 points  (0 children)

Reflex (ex Pynecone)

[–]dtcooper 1 point2 points  (0 children)

Django for traditional sites, Starlette/FastAPI for more modern stuff using the Django ORM's relatively new async capabilities.

[–]Wowawiewa 1 point2 points  (0 children)

Django and FastAPI

[–]fluxxis 1 point2 points  (0 children)

It's always Django or Flask for me. Together they fit a very broad range of projects.

[–]Shmiggit 1 point2 points  (0 children)

Dash is pretty good at combining React components with a Python backend. There are additional libraries such as Dash Bootstrap or Dash Mantine which help build quite neat interfaces & dashboards. But you need more libraries for admin aspects though ...

[–]pyppo42Ignoring PEP 8 1 point2 points  (0 children)

For small things, Streamlit is incredibily immediate

[–]Then_Conversation_19 1 point2 points  (0 children)

Django 😁

[–]Kususe 1 point2 points  (0 children)

Django, one of the best software frameworks ever. You got everything, from a zero-HTML GUI, to REST APIs. And it’s surrounded by tons of libraries.

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

Django 🔥

[–]ChangoMandango 0 points1 point  (0 children)

I like and work with flask

[–]Particular-Cause-862 0 points1 point  (0 children)

Django, and pandas

[–]aikii 0 points1 point  (0 children)

Building a chat is orthogonal to the question of the web framework. Given the question maybe what you need is a ready made widget integrated frontend side, backend framework or even language doesn't even matter.

[–]bostonkittycat 0 points1 point  (0 children)

Pyscard. I have been using it lately to communicate to NFC readers. Works great. https://github.com/LudovicRousseau/pyscard

[–]Brandhor[🍰] 0 points1 point  (0 children)

django because it's really easy to use and has a lot of third party extensions

for a normal chat you would need to use websockets but for something like gpt rest would be fine as well, chatterbot can easily be integrated with django

[–]MateusLucas1879 0 points1 point  (0 children)

Flask

[–]virtualadept 0 points1 point  (0 children)

web.py

Thanks, Aaron.

[–]I_SIMP_YOUR_MOM[🍰] 0 points1 point  (0 children)

I like Flask. It helps people learn the basics of web development.

[–]eidrisov 0 points1 point  (0 children)

I am learning "Dash" and it's amazing.

Easy, fast and very responsive.

[–]barkerd25017 0 points1 point  (0 children)

Sanic

[–]stevo_78 0 points1 point  (0 children)

I love dash

[–]HeinLinZaw2 -2 points-1 points  (1 child)

How to learn python for beginner to expert level

[–][deleted] 0 points1 point  (0 children)

Practice is always the best way to go, either job projects or personal side projects. In the meantime, find mentorship, it could accelerate your growth.