1# in views define the int slugs then the url mapping is like this
2
3from django.urls import path, re_path
4
5from . import views
6
7urlpatterns = [
8 path('articles/2003/', views.special_case_2003),
9 re_path(r'^articles/(?P<year>[0-9]{4})/$', views.year_archive),
10 re_path(r'^articles/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$', views.month_archive),
11 re_path(r'^articles/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<slug>[\w-]+)/$', views.article_detail),
12]
13