[Solved]-How to write custom django manage.py commands in multiple apps

17👍

As @Babu said in the comments, It looks like you may not have added your app to INSTALLED_APPS in your settings.py.

It’s also possible that you’re missing the __init__.py files (that are required in python modules) from the management and commands folders.

Alternatively, (sorry to say this) you may have misspelt “management” or “commands”, or even the name of the command you’re running.

👤meshy

1👍

Most likely, you did not include app B in your settings.py

If you just run python manage.py with no command specified, it will print the list of commands Django can find.

This can help rule out misspelling the command name, but doesn’t answer the question of whether or not you made management and commands both packages, or if app B simply isn’t listed in your settings.INSTALLED_APPS

1👍

It looks like you have not registered your app B in INSTALLED_APPS in our settings.py.
You also need to add a __init__.py file in both folders(management and commands) to make it as a package. Make Sure you spell folder names correctly.

Leave a comment