python - If multiple Django apps define the same custom management command, which is used? -
the docs silent on questios. commands registered in order, later apps (in settings.installed_apps
order) overriding previous commands (whether custom other apps or built-in django commands)?
the answer yes, of current 1.7 release.
see this line in django source see logic implemented: in order of apps per settings.installed_apps
tuple, each app's management commands added dictionary of commands (which initialized django's built-in commands here), single slot given command name, last 1 added sticks, overriding previous app's (or django's built-in) command same name; when executing command (code here), django uses dictionary above decide command logic use.
note haven't found documentation of this, should technically considered unofficial behavior.
Comments
Post a Comment