您有一个网址接受Django中的first_name和last_name:
('^(?P<first_name>[a-zA-Z]+)/(?P<last_name>[a-zA-Z]+)/$','some_method'),@H_403_3@如何包含title的OPTIONAL URL令牌,而不创建任何新行。我的意思是,在一个理想的情况下:
#A regex constant OP_REGEX = r'THIS IS OPTIONAL<title>[a-z]' #Ideal URL ('^(?P<first_name>[a-zA-Z]+)/(?P<last_name>[a-zA-Z]+)/OP_REGEX/$',@H_403_3@这是可能的,而不创建新行。
('^(?P<first_name>[a-zA-Z]+)/(?P<last_name>[a-zA-Z]+)/(?P<title>[a-zA-Z]+)/$',