I've a project in django 3.2 and I've updated (pip install -r requirements.txt) to version 4.0 (new release) and I've currently the below error when I run the server in a virtual environment. I use DRF.
Can't import => from rest_framework import routers in urls.py
from django.conf.urls import url ImportError: cannot import name 'url' from 'django.conf.urls'
As per the Django docs here:
url(regex, view, kwargs=None, name=None)¶ This function is an alias to django.urls.re_path().
Deprecated since version 3.1: Alias of django.urls.re_path() for backwards compatibility.
django.conf.urls.url() was deprecated since Django 3.1, and as per the release notes here, is removed in Django 4.0+.
You can resolve the issue using