register_converter
Registers a custom URL converter for use in URL patterns, updating the global converter registry and clearing internal caches for route resolution.
def register_converter(
converter: class,
type_name: string
) - > null
Registers a custom path converter for use in URL patterns and clears relevant internal caches to ensure the new converter is recognized.
Parameters
| Name | Type | Description |
|---|---|---|
| converter | class | The converter class that implements the required to_python and to_url methods. |
| type_name | string | The name to be used in path expressions, such as 'uuid' or 'int', which must be unique. |
Returns
| Type | Description |
|---|---|
null | Nothing is returned; the function performs a registration side effect. |