MCPcopy
hub / github.com/django/django / find_commands

Function find_commands

django/core/management/__init__.py:29–39  ·  view source on GitHub ↗

Given a path to a management directory, return a list of all the command names that are available.

(management_dir)

Source from the content-addressed store, hash-verified

27
28
29def find_commands(management_dir):
30 """
31 Given a path to a management directory, return a list of all the command
32 names that are available.
33 """
34 command_dir = os.path.join(management_dir, "commands")
35 return [
36 name
37 for _, name, is_pkg in pkgutil.iter_modules([command_dir])
38 if not is_pkg and not name.startswith("_")
39 ]
40
41
42def load_command_class(app_name, name):

Callers 2

get_commandsFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by 1