citusdata / django-multitenant

Python/Django support for distributed multi-tenant databases like Postgres+Citus
MIT License
710 stars 116 forks source link

Perhaps not full documented: db layer for multitentant #121

Open ReneFroger opened 2 years ago

ReneFroger commented 2 years ago

In the documentation https://github.com/citusdata/django-multitenant#automating-composite-foreign-keys-at-db-layer it's said that the django.backends.postgresql could be replaced withdjango_multitenant.backends.postgresqlinENGINEinsettings.py.

But when I do this and run the server, I get the error:

django.core.exceptions.ImproperlyConfigured: 'django_multitenant.db.backends.postgresql' isn't an available database backend or couldn't be imported. Check the above exception. To use one of the built-in backends, use 'django.db.backends.XXX', where XXX is one of:     'mysql', 'oracle', 'postgresql', 'sqlite3'`

Perhaps it's missing an import, but it's not clear which import I should make. So I think it should be explained in the documentation as well?

JelteF commented 2 years ago

did you install the package? As shown at the top of the documentation:

pip install --no-cache-dir django_multitenant
ReneFroger commented 2 years ago

Yes, I did. The package is listed in my pip packages list:

$ python -m pip list | grep multi django-multitenant 3.0.0

In both global environment as in Python virtual environment.