django-db-multitenant icon indicating copy to clipboard operation
django-db-multitenant copied to clipboard

Per database management command execution

Open LukeyJohnson opened this issue 6 years ago • 2 comments

I have a working installation of django-db-multitenant, its perfect for my use case thanks.

However, I cannot get the management commands to work, such as: TENANT_DATABASE_NAME=example.com ./manage.py migrate

How do I call such a command from a venv in Windows 10 Python installation?

Also, do you have a solution for looping the migration commands over multiple databases in MySQL (like database names app_bqt, app_cre, app_trb etc) ?

LukeyJohnson avatar Jan 04 '19 00:01 LukeyJohnson

@LukeyJohnson Have a look at the update_from_env function found in utils.py and related documentation in the README.

Please be aware that I have an open PR to fix an issue there related to how the utils code interacts with Django's cache (in case you're using it).

crolfe avatar Feb 08 '19 23:02 crolfe

Hi guys,

I have taken a look at this, but am struggling to see how I would create a new tennant using this method, could an example of a new tennant be created.

thanks

dowling-john avatar Jul 11 '22 08:07 dowling-john