ox.urls
This module provides urls for Oxylus applications.
It scans over applications’ directory for module urls from which it gets:
urls: the list of urls to regular views. They will be namespaced under the app label. The final url will look like:{root_url}/{path}.
api_urls: the list of urls to API views. They will be namespaced as{app.label}-api. The final url will look like:api/{root_url}/{path}.
Where root_url is specified on the AppConfig instance (if none, uses app label). Note that only subclasses of ox.core.apps.AppConfig are taken in account).
Thoses urls will be automatically added to url patterns.
- class ox.urls.Router[source]
This class is used to retrieve urls in app’s
urlsmodule, under keysurlsandapi_urls.It will generate three kind of url:
/{url}: forurls’s absolute url (starting with a/);/{app_root_url}/{url}: forurls’s relative url;/api/{app_root_url}/: for url of api views and viewsets (declared usingapi_urls);
- class Discover(module_names=None, **handlers)[source]
- module_names: str | Iterable[str] = 'urls'
A single or a list of module names to look-up for.