from django.urls import re_path urlpatterns = [ re_path(r'^blog/(page-(d+)/)?$', blog_articles), # bad re_path(r'^comments/(?:page-(?P<page_number>d+)/)?$', comments), # good ]