database

How to Use Database Router for Multiple Databases

August 21, 2022
database

Using multiple database in the Django project you may face with situation when you need apply migrations for some app or model just to the some databse instead all of defined databases, or you need to perform read/write actions for models of the some application only for specific database instead specifying .using(db) every time.

...

How to Use Multiple Databases in Django

August 15, 2022
Database
database, orm

Django ORM very well designed to use multiple relational databases (regardless engine) in single project. To start using two databases in Django project you need to configure connection to all of them in the settings.py file.

...

Set database tables prefix in Django

August 14, 2022
Database
database, packages

Sometimes when you using same database by different applications it is a good (or required) to separate tables between apps to avoid any conflicts. In this case you can find useful django-database-prefix library available on PyPi Installation # pip pip install django-database-prefix poetry poetry add django-database-prefix pipenv pipenv install django-database-prefix After package installation you need to add it to the your project’s settings.py file on first place. 'django_database_prefix', 'django.contrib.admin', 'django.contrib.auth', 'django. ...