A lot of people are using one of Django or Flask, and some are even strongly opiniated about either framework to build a REST API. I moved from Flask to Django a few months ago, and I am never going back. I want to see if I can make other people take a good decision!
If you played around with Flask, you were probably trying to serve some functionality requiring data, and therefore a database. You probably started with SQLite, because configuring Flask to a database looked a bit confusing or at least time-consuming, because you probably rely on an ORM like SQLAlchemy to manage your database connection, unless you feel like going rogue and using f-strings to write SQL queries (good luck with that!). And because you started with SQLite, you struggled when you needed something more professional like MySQL or PostgreSQL while doing the switch.
With Django, you get your SQL connection for free. Just follow the documentation that tells you which database engine you need, whether you need MySQL, PostgreSQL, MariaDB, Oracle, or even SQLite for toy projects. The engine manages your connection for you.
You want a database table? If you know basic python classes, you have all you need! No need to write queries to create your tables! Specify a class inheriting from django.db.models.Model to define a database table, class attributes to define all possible column types in a very customizable way, allowing you to track with one-liners features such as:
Can you even imagine solving the problems those features solve by using SQLAlchemy? Personally, I would find that a big waste of time!
#django #django-rest-framework #data-science #python