Expose preserve_case option from slugify

This commit is contained in:
Deniz Turgut 2020-04-21 00:26:00 +03:00
commit bd699d34e8
5 changed files with 42 additions and 12 deletions

View file

@ -628,6 +628,12 @@ corresponding ``*_URL`` setting as string, while others hard-code them:
in auto-generated slugs. Otherwise, unicode characters will be replaced
with ASCII equivalents.
.. data:: SLUGIFY_PRESERVE_CASE = False
Preserve uppercase characters in the slugs. Set ``True`` to keep the
uppercase characters in the ``SLUGIFY_SOURCE`` as is.
.. data:: SLUG_REGEX_SUBSTITUTIONS = [
(r'[^\\w\\s-]', ''), # remove non-alphabetical/whitespace/'-' chars
(r'(?u)\\A\\s*', ''), # strip leading whitespace