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

def fetch_command(self, subcommand):

    try:
        app_name = get_commands()[subcommand]
    except KeyError:
        sys.stderr.write(("Unknown    command:    %r\nType    '%s    help'    for    usage.\n" % (subcommand, self.prog_name)))
        sys.exit(1)
    if isinstance(app_name, BaseCommand):
        klass = app_name
    else:
        klass = load_command_class(app_name, subcommand)
    return klass
