Management

Debug Command

class integreat_cms.core.management.debug_command.DebugCommand(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: LogCommand

Base class for management commands which can only be executed in debug mode

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
add_arguments(parser)[source]

Entry point for subclassed commands to add custom arguments.

add_base_argument(parser, *args, **kwargs)[source]

Call the parser’s add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.

base_stealth_options = ('stderr', 'stdout')[source]
check(app_configs=None, tags=None, display_num_errors=False, include_deployment_checks=False, fail_level=40, databases=None)[source]

Use the system check framework to validate entire Django project. Raise CommandError for any serious message (error or critical errors). If there are only light messages (like warnings), print them to stderr and don’t raise an exception.

check_migrations()[source]

Print a warning if the set of migrations on disk don’t match the migrations in the database.

create_parser(prog_name, subcommand, **kwargs)[source]

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

execute(*args: Any, **options: Any) None[source]

Try to run the command

Parameters:
  • *args (Any) – The supplied arguments

  • **options (Any) – The supplied keyword options

Raises:

CommandError – When the input is invalid

Return type:

None

get_version()[source]

Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

Parameters:
  • args (Any) –

  • options (Any) –

Return type:

None

help = ''[source]
output_transaction = False[source]
print_help(prog_name, subcommand)[source]

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

requires_migrations_checks = False[source]
requires_system_checks = '__all__'[source]
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.

set_logging_stream() None[source]

Set the output stream to the command’s stdout/stderr wrapper. Has to be called as part of the command’s handle() function.

Return type:

None

stealth_options = ()[source]
suppressed_base_arguments = {}[source]

Log Command

class integreat_cms.core.management.log_command.LogCommand(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

Base class for management commands to set the stream handler of the logger to the command’s stdout wrapper

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
add_arguments(parser)[source]

Entry point for subclassed commands to add custom arguments.

add_base_argument(parser, *args, **kwargs)[source]

Call the parser’s add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.

base_stealth_options = ('stderr', 'stdout')[source]
check(app_configs=None, tags=None, display_num_errors=False, include_deployment_checks=False, fail_level=40, databases=None)[source]

Use the system check framework to validate entire Django project. Raise CommandError for any serious message (error or critical errors). If there are only light messages (like warnings), print them to stderr and don’t raise an exception.

check_migrations()[source]

Print a warning if the set of migrations on disk don’t match the migrations in the database.

create_parser(prog_name, subcommand, **kwargs)[source]

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

execute(*args, **options)[source]

Try to execute this command, performing system checks if needed (as controlled by the requires_system_checks attribute, except if force-skipped).

get_version()[source]

Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

Parameters:
  • args (Any) –

  • options (Any) –

Return type:

None

help = ''[source]
output_transaction = False[source]
print_help(prog_name, subcommand)[source]

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

requires_migrations_checks = False[source]
requires_system_checks = '__all__'[source]
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.

set_logging_stream() None[source]

Set the output stream to the command’s stdout/stderr wrapper. Has to be called as part of the command’s handle() function.

Return type:

None

stealth_options = ()[source]
suppressed_base_arguments = {}[source]