How to programatically run custom command for specific schema using django-tenants?

101 views Asked by At

I am new with django-tenants. I want to programatically run a cummand I have created with management.call_command() but I am getting error. Can someone help me with this?

This command runs without error. I want to achieve same programatically.

python manage.py tenant_command load_some_data --schema=<schema_name>

my code:

call_command('tenant_command', 'load_user_groups', schema_name=schema_name) I get following error:

 File "/home/stackuser/Desktop/DjangoPr/env/lib/python3.10/site-packages/django/core/management/__init__.py", line 114, in call_command
    app_name = get_commands()[command_name]
TypeError: unhashable type: 'list'
0

There are 0 answers