BloomERP

Route types and registration options

Route types

Use searchable and translatable on a registration to override its route type's defaults.

TypeTransportExample pathURL name prefixModel requiredModule requiredSearchable by defaultTranslated by defaultDescription
apphttp/settings/—NoNoYesYesA global application page.
modelhttp/sales/customers/import/—YesYesYesYesA page for a model's collection. The router resolves the model's module.
detailhttp/sales/customers/<int_or_uuid:pk>/details/—YesYesYesYesA page for one model record. The router adds the record's primary-key parameter.
modulehttp/sales/dashboard/—NoYesYesYesA page mounted under a module supplied via modules.
componenthttp/components/widgets/preview/components_NoNoNoNoA global component endpoint, typically used by HTMX. The router prefixes path with /components/ and preserves complete re_path patterns.
apihttp/api/status/—NoNoNoNoA global HTTP API endpoint mounted under /api/.
api_modelhttp/api/customers/—YesNoNoNoAn HTTP API endpoint mounted under a model's collection path.
api_detailhttp/api/customers/<int_or_uuid:pk>/—YesNoNoNoAn HTTP API endpoint for one model record.
websocketwebsocket/ws/notifications/—NoNoYesYesA Channels consumer registered in the WebSocket URL patterns.
mcpmcp——NoNoNoNoA pathless MCP tool registered with a tool contract.
mcp_resourcemcp——NoNoNoNoA pathless MCP resource registered under a URI or URI template.

Route type details

app

Use app for a page shared across the application, such as settings or the inbox. Declare path relative to the application root. For example, path="settings/" mounts the page at /settings/. Give the route a stable url_name so templates and views can reverse it.

model

Use model for a page that works with a model's collection, such as a list, creation form, or import wizard. Select the models through models. The router uses each model's registered module and plural name to build the collection URL, then appends your path. For example, path="import/" can resolve to /sales/customers/import/.

detail

Use detail for a page tied to one record, such as a details tab or a confirmation form. Select the models through models and declare a path relative to the record. The router inserts <int_or_uuid:pk> before that path. Reverse the route with the record's primary key as pk.

module

Use module for a page that belongs to a module, such as its dashboard. Pass a module ID, a module definition, or a list through modules. The router mounts the view under each selected module's resolved path. For a module mounted at /sales/, path="dashboard/" resolves to /sales/dashboard/.

component

Use component for a separately requested part of a page, such as an HTML fragment loaded through HTMX. Declare path="widgets/preview/" and a reverse name such as widget_preview to get /components/widgets/preview/ and components_widget_preview. If you use re_path, supply the complete URL pattern.

api

Use api for an HTTP endpoint with application-wide scope, such as a status endpoint. The router mounts path="status/" at /api/status/. Supply an sdk contract when the endpoint should appear in the generated SDK.

api_model

Use api_model for collection operations such as listing or creating records. Select the models through models. Each route starts at the model's API collection path, such as /api/customers/. Use path="/" for the collection itself or supply a suffix for a separate collection operation.

api_detail

Use api_detail for an operation on one record, such as retrieving or updating it. Select the models through models. The router inserts <int_or_uuid:pk> after the model's API collection path and before any suffix you supply. The view can use the captured pk to resolve the record.

websocket

Use websocket for a Django Channels consumer that handles live messages or notifications. Register the consumer class so the router can call as_asgi(). Declare the full path, such as path="ws/notifications/", for the WebSocket URL configuration.

mcp

Use mcp for an operation that an MCP client can invoke as a tool. Supply a McpTool contract through mcp to declare the tool's inputs and behavior. The registered url_name identifies the tool. Leave path and re_path unset for an MCP-only route.

mcp_resource

Use mcp_resource for content an MCP client can read by URI, such as a guide or an application reference. Supply a McpResource for a fixed URI or a McpResourceTemplate for parameterized content. The contract supplies the resource address, so leave path and re_path unset.

Registration options

OptionTypeDefault
pathstrNone
re_pathOptional[str]None
route_typeRouteType | str | NoneNone
modelsModelSelectorNone
modulesModuleConfig | type[BloomerpModule] | BloomerpModule | str | list[ModuleConfig | type[BloomerpModule] | BloomerpModule | str] | NoneNone
exclude_modelsModelSelectorNone
nameOptional[str]None
descriptionOptional[str]None
url_nameOptional[str]None
overrideboolFalse
translatableOptional[bool]None
searchableOptional[bool]None
message_format_valuesOptional[dict[str, object]]None
mcpUnion[McpTool, McpResource, McpResourceTemplate, NoneType]None
sdkSdkEndpoint | list[SdkEndpoint] | tuple[SdkEndpoint, ...] | NoneNone