from django.conf.urls import url
from django.contrib import admin
from django.http import HttpResponse


urlpatterns = [
    url(r'^$', lambda request, *args, **kwargs: HttpResponse()),
    url(r'^admin/', admin.site.urls),
]

from django.urls import re_path
from django.contrib import admin
from django.http import HttpResponse


urlpatterns = [
    re_path(r'^$', lambda request, *args, **kwargs: HttpResponse()),
    re_path(r'^admin/', admin.site.urls),
]

Replace url() with re_path() available in newer Django
Replace url() with re_path() available in newer Django

- from django.conf.urls import url
+ from django.urls import re_path
  from django.contrib import admin
  from django.http import HttpResponse
  
  
  urlpatterns = [
-     url(r'^$', lambda request, *args, **kwargs: HttpResponse()),
+     re_path(r'^$', lambda request, *args, **kwargs: HttpResponse()),
-     url(r'^admin/', admin.site.urls),
+     re_path(r'^admin/', admin.site.urls),
  ]
  
Replace url() with re_path() available in newer Django
## Code Before:
from django.conf.urls import url
from django.contrib import admin
from django.http import HttpResponse


urlpatterns = [
    url(r'^$', lambda request, *args, **kwargs: HttpResponse()),
    url(r'^admin/', admin.site.urls),
]

## Instruction:
Replace url() with re_path() available in newer Django
## Code After:
from django.urls import re_path
from django.contrib import admin
from django.http import HttpResponse


urlpatterns = [
    re_path(r'^$', lambda request, *args, **kwargs: HttpResponse()),
    re_path(r'^admin/', admin.site.urls),
]
