This commit eliminates deprecation warnings that are raised on Django
3.1 or 3.2. Namely, urls.url() has been deprecated: URL definitions
are encouraged to use one of either path or re_path.
However, there's no need to use regular expressions for a simple "match
the start of the string, a pattern, then the end of the string."
Is this safe?
This change works on Django 2.0 or greater. django-waffle requires a
minimum of Django 2.2 (earlier releases are not unsupported by Django
anyway), so this should be a safe change.
This commit eliminates deprecation warnings that are raised on Django 3.1 or 3.2. Namely,
urls.url()
has been deprecated: URL definitions are encouraged to use one of eitherpath
orre_path
.When was
url()
deprecated?The Django 3.1 "miscellaneous" release notes have a single bullet point about this change:
Are there alternatives?
The simplest change is to just use
re_path
instead ofconf.urls.url
, since Django 2.0 and greater havere_path
available:https://docs.djangoproject.com/en/2.0/ref/urls/#django.urls.re_path
However, there's no need to use regular expressions for a simple "match the start of the string, a pattern, then the end of the string."
Is this safe?
This change works on Django 2.0 or greater.
django-waffle
requires a minimum of Django 2.2 (earlier releases are not unsupported by Django anyway), so this should be a safe change.