  
  from .views import MockView
  
  urlpatterns = [
      url(r'^$', MockView.as_view()),
      url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')),
  ]
 
</s> remove     url(r'^$', MockView.as_view()),
 </s> add     path('', MockView.as_view()), </s> remove from django.conf.urls import url
 </s> add from django.urls import path </s> remove from django.conf.urls import include, url
 </s> add from django.urls import include, path </s> remove     url(r'^auth-token/$', obtain_auth_token),
    url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')),
 </s> add     path('auth-token/', obtain_auth_token),
    path('auth/', include('rest_framework.urls', namespace='rest_framework')), </s> remove     url(r'^$', MockView.as_view()),
    url(r'^echo/$', EchoView.as_view()),
    url(r'^upload/$', FileUploadView.as_view())
 </s> add     path('', MockView.as_view()),
    path('echo/', EchoView.as_view()),
    path('upload/', FileUploadView.as_view())
    path('', MockView.as_view()),
    path('auth/', include('rest_framework.urls', namespace='rest_framework')),
  
  from .views import MockView
  
  urlpatterns = [
    path('', MockView.as_view()),
    path('auth/', include('rest_framework.urls', namespace='rest_framework')),
    path('', MockView.as_view()),
    path('auth/', include('rest_framework.urls', namespace='rest_framework')),
  ]
keep keep keep keep replace replace keep
 Replace all url() calls with path() or re_path() (#7512)

* url() is deprecated in Django 3.1

* update given feedbacks on url() is deprecated in Django 3.1

* Fix test_urlpatterns.py to continue testing mixed re_path() and path()

* Fix one missed reference

Co-authored-by: sanjusci <sanju.sci9@gmail.com> 
tests/browsable_api/auth_urls.py