include
Parses and validates URL configuration modules or pattern lists, returning a tuple containing the module, application name, and namespace. It dynamically imports string-based module paths and ensures that the provided configuration adheres to Django's namespacing and internationalization requirements.
def include(
arg: str|tuple|list,
namespace: str = None
) - > tuple
Includes a full URLconf module or a list of URL patterns into the current routing configuration. This allows for modularizing URL definitions and applying namespaces to groups of routes.
Parameters
| Name | Type | Description |
|---|---|---|
| arg | `str | tuple |
| namespace | str = None | The instance namespace for the included URL patterns, used to differentiate between multiple instances of the same application. |
Returns
| Type | Description |
|---|---|
tuple | A 3-tuple containing the URLconf module or pattern list, the application name, and the instance namespace. |