Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tilde (~) symbol on Django regex url (Cookiecutter Django)

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/$',
    ...
]
like image 545
Nadav Avatar asked Nov 28 '17 20:11

Nadav


1 Answers

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

like image 54
knbk Avatar answered Sep 25 '22 22:09

knbk