slugify
Convert to ASCII if 'allow_unicode' is False. Convert spaces or repeated dashes to single dashes. Remove characters that aren't alphanumerics, underscores, or hyphens. Convert to lowercase. Also strip leading and trailing whitespace, dashes, and underscores.
def slugify(
value: Any,
allow_unicode: boolean = False
) - > string
Convert to ASCII if 'allow_unicode' is False. Convert spaces or repeated dashes to single dashes. Remove characters that aren't alphanumerics, underscores, or hyphens. Convert to lowercase. Also strip leading and trailing whitespace, dashes, and underscores.
Parameters
| Name | Type | Description |
|---|---|---|
| value | Any | The input string or lazy text object to be converted into a slug |
| allow_unicode | boolean = False | Whether to allow non-ASCII characters in the resulting slug; if False, characters are converted to ASCII or removed |
Returns
| Type | Description |
|---|---|
string | The processed string transformed into a URL-friendly slug format |