MCPcopy
hub / github.com/django/django / load_command_class

Function load_command_class

django/core/management/__init__.py:42–49  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

40
41
42def 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

Callers 3

call_commandFunction · 0.85
fetch_commandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected