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.
(app_name, name)
| 40 | |
| 41 | |
| 42 | def load_command_class(app_name, name): |
| 43 | """ |
| 44 | Given a command name and an application name, return the Command |
| 45 | class instance. Allow all errors raised by the import process |
| 46 | (ImportError, AttributeError) to propagate. |
| 47 | """ |
| 48 | module = import_module("%s.management.commands.%s" % (app_name, name)) |
| 49 | return module.Command() |
| 50 | |
| 51 | |
| 52 | @functools.cache |
no outgoing calls
no test coverage detected