Tilde (~) symbol on Django regex url (Cookiecutter Django)
Asked Answered
M

1

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/$',
    ...
]
Manslaughter answered 28/11, 2017 at 20:25 Comment(0)
T
6

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

Telega answered 28/11, 2017 at 20:33 Comment(1)
@Manslaughter Not a clue.Telega

© 2022 - 2024 — McMap. All rights reserved.