from django.urls import path, re_path, register_converter from . import views from . import converters register_converter(converters.FourDigitYearConverter, "year4") urlpatterns = [ path('', views.index), # http://127.0.0.1:8000 path('cats//', views.categories), # http://127.0.0.1:8000/cats/1/ path('cats//', views.categories_by_slug), # http://127.0.0.1:8000/cats/asdfad/ # re_path(r"^archive/(?P[0-9]{4})", views.archive), path('archive/', views.archive), ]