Management Command: djxi_routes ================================ The ``djxi_routes`` management command prints a list of all ``DXEndpointBattery`` routes registered in the project, making it easy to verify URL configuration at a glance. Usage ----- .. code-block:: bash # Default table output python manage.py djxi_routes # JSON output (useful for tooling / CI assertions) python manage.py djxi_routes --format=json Example table output: .. code-block:: text Battery URL Pattern Methods Name ───────────────────────────────────────────────────────────────── TodoBattery dx/list GET todo:list TodoBattery dx/item/ GET todo:item TodoBattery dx/item/new GET,POST todo:add-item TodoBattery dx/item//delete DELETE todo:delete-item ItemBattery htmx/list GET items:list ItemBattery htmx/create POST items:create Example JSON output: .. code-block:: json [ { "battery": "TodoBattery", "url": "dx/list", "methods": ["GET"], "name": "todo:list" } ] Options ------- ``--format`` Output format. Accepted values: - ``table`` (default) — aligned, coloured ASCII table. - ``json`` — JSON array with keys ``battery``, ``url``, ``methods``, ``name``. Discovery --------- The command discovers batteries by: 1. Iterating over all apps in ``INSTALLED_APPS``. 2. For each app, attempting to import the modules listed in ``DJXI_ROUTE_MODULES`` (default: ``["views", "endpoints", "batteries"]``). This triggers any battery class definitions inside those modules. 3. Recursively collecting all ``DXEndpointBattery`` subclasses via ``__subclasses__()``. If your batteries are defined in a module with a non-standard name, add that name to ``DJXI_ROUTE_MODULES``: .. code-block:: python # settings.py DJXI_ROUTE_MODULES = ["views", "endpoints", "batteries", "htmx_views"] Limitations ----------- The discovery heuristic relies on importing common module names. It will miss batteries that are: - Defined only in modules not listed in ``DJXI_ROUTE_MODULES``. - Imported conditionally (e.g. inside a function). A registry-based discovery mechanism (which would make this reliable) is planned — see ``FRAGMENTS.md`` item 12.