old_contents: from django.conf.urls import include, patterns, url
  from postapi import views
  from rest_framework.urlpatterns import format_suffix_patterns
  
  urlpatterns = patterns(
      "postapi.views",
      url(r"^$", "api_root", name="postapi-index"),
      url(r"^boxes$", views.BoxList.as_view(), name="box-list"),
      url(
          r"^boxes/(?P<name>[0-9a-zA-Z-_]+)$",
          views.BoxDetail.as_view(),
          name="box-detail",
      ),
      url(r"^posts$", views.PostList.as_view(), name="post-list"),
      url(r"^posts/(?P<pk>[0-9]+)$", views.PostDetail.as_view(), name="post-detail"),
      url(
          r"^delivered-posts$",
          views.DeliveredPostList.as_view(),
          name="deliveredpost-list",
      ),
      url(
          r"^delivered-posts/(?P<pk>[0-9]+)$",
          views.DeliveredPostDetail.as_view(),
          name="deliveredpost-detail",
      ),
      url(r"^subscriptions$", views.SubscriptionList.as_view(), name="subscription-list"),
      url(
          r"^subscriptions/(?P<pk>[0-9]+)$",
          views.SubscriptionDetail.as_view(),
          name="subscription-detail",
      ),
      url(r"^actions/deliver", "deliver", name="deliver-action"),
      url(r"^actions/sync", "sync", name="sync-action"),
      url(r"^users$", views.UserList.as_view(), name="user-list"),
      url(r"^users/(?P<pk>[0-9]+)$", views.UserDetail.as_view(), name="user-detail"),
  )
  
  urlpatterns = format_suffix_patterns(urlpatterns)
  
new_contents: from django.urls import path
  from rest_framework.urlpatterns import format_suffix_patterns
  
  from postapi import views as postapi
  
  urlpatterns = [
      path("", postapi.api_root, name="postapi-index"),
      path("boxes", postapi.BoxList.as_view(), name="box-list"),
      path(
          "boxes/<slug:name>",
          postapi.BoxDetail.as_view(),
          name="box-detail",
      ),
      path("posts", postapi.PostList.as_view(), name="post-list"),
      path("posts/<int:pk>", postapi.PostDetail.as_view(), name="post-detail"),
      path(
          "delivered-posts",
          postapi.DeliveredPostList.as_view(),
          name="deliveredpost-list",
      ),
      path(
          "delivered-posts/<int:pk>",
          postapi.DeliveredPostDetail.as_view(),
          name="deliveredpost-detail",
      ),
      path("subscriptions", postapi.SubscriptionList.as_view(), name="subscription-list"),
      path(
          "subscriptions/<int:pk>",
          postapi.SubscriptionDetail.as_view(),
          name="subscription-detail",
      ),
      path("actions/deliver", postapi.deliver, name="deliver-action"),
      path("actions/sync", postapi.sync, name="sync-action"),
      path("users", postapi.UserList.as_view(), name="user-list"),
      path("users/<int:pk>", postapi.UserDetail.as_view(), name="user-detail"),
  ]
  
  urlpatterns = format_suffix_patterns(urlpatterns)
  
subject: upgrade to Django 4.x