class documentation

class ManagementUtility: (source)

View In Hierarchy

Encapsulate the logic of the django-admin and manage.py utilities.

Method __init__ Undocumented
Method autocomplete Output completion suggestions for BASH.
Method execute Given the command-line arguments, figure out which subcommand is being run, create a parser appropriate to that command, and run it.
Method fetch_command Try to fetch the given subcommand, printing a message with the appropriate command called from the command line (usually "django-admin" or "manage.py") if it can't be found.
Method main_help_text Return the script's main help text, as a string.
Instance Variable argv Undocumented
Instance Variable prog_name Undocumented
Instance Variable settings_exception Undocumented
def __init__(self, argv=None): (source)

Undocumented

def autocomplete(self): (source)

Output completion suggestions for BASH. The output of this function is passed to BASH's `COMREPLY` variable and treated as completion suggestions. `COMREPLY` expects a space separated string as the result. The `COMP_WORDS` and `COMP_CWORD` BASH environment variables are used to get information about the cli input. Please refer to the BASH man-page for more information about this variables. Subcommand options are saved as pairs. A pair consists of the long option string (e.g. '--exclude') and a boolean value indicating if the option requires arguments. When printing to stdout, an equal sign is appended to options which require arguments. Note: If debugging this function, it is recommended to write the debug output in a separate file. Otherwise the debug output will be treated and formatted as potential completion suggestions.

def execute(self): (source)

Given the command-line arguments, figure out which subcommand is being run, create a parser appropriate to that command, and run it.

def fetch_command(self, subcommand): (source)

Try to fetch the given subcommand, printing a message with the appropriate command called from the command line (usually "django-admin" or "manage.py") if it can't be found.

def main_help_text(self, commands_only=False): (source)

Return the script's main help text, as a string.

Undocumented

prog_name: str = (source)

Undocumented

settings_exception = (source)

Undocumented