from django.conf.urls import url
from django.views.generic import TemplateView

urlpatterns = [
    url(r"^$", TemplateView.as_view(template_name="homepage.html")),
    url(r"^remote.html$", TemplateView.as_view(template_name="remote.html"), name="remote.html"),
]

from django.urls import path, re_path
from django.views.generic import TemplateView

urlpatterns = [
    path('', TemplateView.as_view(template_name="homepage.html")),
    re_path(r"^remote.html$", TemplateView.as_view(template_name="remote.html"), name="remote.html"),
]

Upgrade code to Python 3.6+, Django 2.2 and remove deprecations
Upgrade code to Python 3.6+, Django 2.2 and remove deprecations

- from django.conf.urls import url
+ from django.urls import path, re_path
  from django.views.generic import TemplateView
  
  urlpatterns = [
-     url(r"^$", TemplateView.as_view(template_name="homepage.html")),
+     path('', TemplateView.as_view(template_name="homepage.html")),
-     url(r"^remote.html$", TemplateView.as_view(template_name="remote.html"), name="remote.html"),
+     re_path(r"^remote.html$", TemplateView.as_view(template_name="remote.html"), name="remote.html"),
  ]
  
Upgrade code to Python 3.6+, Django 2.2 and remove deprecations
## Code Before:
from django.conf.urls import url
from django.views.generic import TemplateView

urlpatterns = [
    url(r"^$", TemplateView.as_view(template_name="homepage.html")),
    url(r"^remote.html$", TemplateView.as_view(template_name="remote.html"), name="remote.html"),
]

## Instruction:
Upgrade code to Python 3.6+, Django 2.2 and remove deprecations
## Code After:
from django.urls import path, re_path
from django.views.generic import TemplateView

urlpatterns = [
    path('', TemplateView.as_view(template_name="homepage.html")),
    re_path(r"^remote.html$", TemplateView.as_view(template_name="remote.html"), name="remote.html"),
]
