django_sorcery.management.base module

Namespaced Django command.

class django_sorcery.management.base.NamespacedCommand(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: django.core.management.base.BaseCommand

Namespaced django command implementation.

commands

Returns the subcommands in the namespace.

create_parser(prog_name, subcommand)[source]

Create and return the ArgumentParser which will be used to parse the arguments to this command.

print_help(prog_name, subcommand)[source]

Print the help message for this command, derived from self.usage().

run_command_from_argv(command, argv)[source]

Runs the subcommand with namespace adjusted argv.

run_from_argv(argv)[source]

Set up any environment changes requested (e.g., Python path and Django settings), then run this command. If the command raises a CommandError, intercept it and print it sensibly to stderr. If the --traceback option is present or the raised Exception is not CommandError, raise it.