Changes between Initial Version and Version 1 of Ticket #31069, comment 3


Ignore:
Timestamp:
Dec 6, 2019, 6:47:48 AM (5 years ago)
Author:
jishansingh

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31069, comment 3

    initial v1  
    1 error is caused by missing ? at end
     1error is caused by missing ? at end of re_path
     2
     3
     4{{{
     5from django.urls import re_path
     6
     7def view(request, optional1, optional2): ...
     8
     9urlpatterns = [
     10  re_path(r'^(?P<optional1>\w+/)(?:(?P<optional2>\w+)/)?', view)
     11]
     12}}}
     13
     14
     15works
Back to Top