5

After installing Cookiecutter Django i saw the tilde (~) symbol in regex and don't know the meaning for url purposes.

It's related to a regular expression or only a way to declare paths?

./users/urls.py:

urlpatterns = [
    ...
    url(
        regex=r'^~redirect/$',
    ...
    url(
        regex=r'^~update/$',
    ...
]
Nadav
  • 574
  • 10
  • 24

1 Answers1

6

~ does not have any special meaning in a regular expression. The url pattern matches the path /~redirect/ literally.

knbk
  • 52,111
  • 9
  • 124
  • 122