Skip to main content

load_command_class

Given a command name and an application name, return the Command class instance. Allow all errors raised by the import process (ImportError, AttributeError) to propagate.

def load_command_class(
app_name: string,
name: string
) - > object

Given a command name and an application name, return the Command class instance. Allow all errors raised by the import process (ImportError, AttributeError) to propagate.

Parameters

NameTypeDescription
app_namestringThe name of the application containing the management commands.
namestringThe specific name of the command module to be imported and instantiated.

Returns

TypeDescription
objectAn instance of the Command class loaded from the specified application's management module.