Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# Set of included URL patterns # Add in the included patterns, after applying the suffixes suffix_pattern, suffix_required)
else: # Regular URL pattern # Add in both the existing and the new urlpattern
""" Supplement existing urlpatterns with corresponding patterns that also include a '.format' suffix. Retains urlpattern ordering.
urlpatterns: A list of URL patterns.
suffix_required: If `True`, only suffixed URLs will be generated, and non-suffixed URLs will not be used. Defaults to `False`.
allowed: An optional tuple/list of allowed suffixes. eg ['json', 'api'] Defaults to `None`, which allows any suffix. """ if len(allowed) == 1: allowed_pattern = allowed[0] else: allowed_pattern = '(%s)' % '|'.join(allowed) suffix_pattern = r'\.(?P<%s>%s)$' % (suffix_kwarg, allowed_pattern) else:
|