def urlconf(patterns, do_not_autogenerate=True):
    """
    A custom url configuration for this action, just like in Django's urls.py.
    The custom urlconf applies after the urlconf for the controller, unless erase is true.

    Example: `["/user/(?P<user_id>\d+)/"]`

    :param patterns: a url pattern or a list of url patterns
    :param do_not_autogenerate: erase the urlconf that was automatically generated
    """
    if type(patterns) not in (list, tuple):
        patterns = tuple(patterns)

    def decorator(action_function):
        action_function.urlconf = patterns
        action_function.urlconf_erase = do_not_autogenerate
        return action_function
    return decorator