Django's Object-Relational Mapping (ORM) layer lets you work with the database in Python code instead of SQL. It maps each model class to a table and each object to a row.
Its advantages:
One API works across all the supported database backends. This database abstraction makes switching databases easier.
Queries use parameters, which protects against SQL injection.
You write queries in Python syntax, and the ORM generates the SQL for you.
Migrations manage the schema automatically as your models change.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.