static
Return a URL pattern for serving files in debug mode.
def static(
prefix: string,
view: callable,
**kwargs: dict
) - > list
Return a URL pattern for serving files in debug mode.
Parameters
| Name | Type | Description |
|---|---|---|
| prefix | string | The URL prefix that triggers the file serving view, typically defined in settings.MEDIA_URL or settings.STATIC_URL. |
| view | callable | The view function responsible for serving the files, defaulting to django.views.static.serve. |
| **kwargs | dict | Additional keyword arguments passed to the view function, such as 'document_root' to specify the filesystem path. |
Returns
| Type | Description |
|---|---|
list | A list containing a URL pattern object if in debug mode and the prefix is local; otherwise, an empty list. |