mik3y / django-db-multitenant

A simple multi-tenancy solution for Django apps.
Other
154 stars 34 forks source link

Per database management command execution #26

Open LukeyJohnson opened 5 years ago

LukeyJohnson commented 5 years ago

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) ?

crolfe commented 5 years ago

@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).

dowling-john commented 1 year ago

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