rest-framework-tutorial icon indicating copy to clipboard operation
rest-framework-tutorial copied to clipboard

Replace instances of 'url' function with 're_path'

Open calvh opened this issue 3 years ago • 2 comments

url is deprecated since django 3.1

https://docs.djangoproject.com/en/3.2/ref/urls/#url

calvh avatar May 17 '21 00:05 calvh

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

ryumada avatar May 28 '22 14:05 ryumada

contributions are welcome

auvipy avatar Nov 21 '22 13:11 auvipy