slugify(allow_unicode=False)
[source]
Converts to ASCII if allow_unicode
is False
(default). Converts spaces to hyphens. Removes characters that aren’t alphanumerics, underscores, or hyphens. Converts to lowercase. Also strips leading and trailing whitespace.
For example:
slugify(value)
If value
is "Joel is a slug"
, the output will be "joel-is-a-slug"
.
You can set the allow_unicode
parameter to True
, if you want to allow Unicode characters:
slugify(value, allow_unicode=True)
If value
is "你好 World"
, the output will be "你好-world"
.
Changed in Django 1.9:
The allow_unicode
parameter was added.
Please login to continue.