Django app: can I run management command that is defined in a dependency?

463 views Asked by At

My Django application called my_app pulls in a dependency called my_dependency. my_dependency declares a management command called useful_thing

Is there a way I can run useful_thing directly from my_app's start.sh?

I've tried calling it directly but it's not found, but maybe there's a way I can configure it to look for management commands from a particular place? I'm new to Django and suspect this is not a sensible thing to try and do.

1

There are 1 answers

0
Alex Vyushkov On

You can call any (properly defined) management command using Django's manage.py, just like any other Django command:

python manage.py userful_thing