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
# 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:
Battery URL Pattern Methods Name
─────────────────────────────────────────────────────────────────
TodoBattery dx/list GET todo:list
TodoBattery dx/item/<int:item_id> GET todo:item
TodoBattery dx/item/new GET,POST todo:add-item
TodoBattery dx/item/<int:item_id>/delete DELETE todo:delete-item
ItemBattery htmx/list GET items:list
ItemBattery htmx/create POST items:create
Example JSON output:
[
{
"battery": "TodoBattery",
"url": "dx/list",
"methods": ["GET"],
"name": "todo:list"
}
]
Options
--formatOutput format. Accepted values:
table(default) — aligned, coloured ASCII table.json— JSON array with keysbattery,url,methods,name.
Discovery
The command discovers batteries by:
Iterating over all apps in
INSTALLED_APPS.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.Recursively collecting all
DXEndpointBatterysubclasses via__subclasses__().
If your batteries are defined in a module with a non-standard name, add that
name to DJXI_ROUTE_MODULES:
# 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.