Skip to main content

get_commands

Return a dictionary mapping command names to their callback applications.

Look for a management.commands package in django.core, and in each
installed application -- if a commands package exists, register all
commands in that package.

Core commands are always included. If a settings module has been
specified, also include user-defined commands.

The dictionary is in the format \{command_name: app_name\}. Key-value
pairs from this dictionary can then be used in calls to
load_command_class(app_name, command_name)

The dictionary is cached on the first call and reused on subsequent
calls.
def get_commands() - > dict

Return a dictionary mapping command names to their callback applications. Look for a management.commands package in django.core, and in each installed application -- if a commands package exists, register all commands in that package. Core commands are always included. If a settings module has been specified, also include user-defined commands. The dictionary is in the format {command_name: app_name}. Key-value pairs from this dictionary can then be used in calls to load_command_class(app_name, command_name) The dictionary is cached on the first call and reused on subsequent calls.

Returns

TypeDescription
dictA dictionary mapping command names to their corresponding application names, used for loading command classes.