79808080

Date: 2025-11-03 16:28:37
Score: 1
Natty:
Report link

This is handled by django.core.management.find_commands :

def find_commands(management_dir):
    """
    Given a path to a management directory, return a list of all the command
    names that are available.
    """
    command_dir = os.path.join(management_dir, "commands")
    return [
        name
        for _, name, is_pkg in pkgutil.iter_modules([command_dir])
        if not is_pkg and not name.startswith("_")
    ]

https://github.com/django/django/blob/05ba1a9228128614fb3c475f1c4bdf0160f44dba/django/core/management/__init__.py#L29

Originally implemented in https://github.com/django/django/commit/302eeaf1904a2f3852b223a563617d4999b4e9ae

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: ulgens