rest-framework-tutorial
rest-framework-tutorial copied to clipboard
Replace instances of 'url' function with 're_path'
url
is deprecated since django 3.1
https://docs.djangoproject.com/en/3.2/ref/urls/#url
This was the error I found too while doing the sixth tutorial
. I fix it by replace the url
into re_path
.
the import: https://github.com/ryumada/python-djangorestframework-tutorial/blob/220c7f3a4cb0bc3c553b50e3409bdc2f5bfb358f/snippets/urls.py#L1
using re_path
instead:
https://github.com/ryumada/python-djangorestframework-tutorial/blob/220c7f3a4cb0bc3c553b50e3409bdc2f5bfb358f/snippets/urls.py#L13-L15
Here is the discussion I've found: https://stackoverflow.com/questions/70319606/importerror-cannot-import-name-url-from-django-conf-urls-after-upgrading-to
contributions are welcome