Pylons/pyramid — pull request #414 by simonyarde (2012-01-23 15:10:50+00:00)
Title: Enhancement: Route-Prefixing re Issue #406 (initial commit)

https://github.com/Pylons/pyramid/issues/406

> route_prefix doesn't allow the prefix pattern to match without a
> trailing slash

Enhances route-prefixing by offering greater configuration flexibility to
resolve issue #406 comprehensively.

Enabled by ``pyramid.allow_empty_pattern`` for BW compatibility.

Relevant toward creating more-explicit configuration behavior and supporting
project designs that use the non-slash-appended route-style without ugly
workarounds.

Supports TIMTOWTDI design defense.

Option to ship Pyramid with whatever default is deemed most 'correct' as the web evolves.

Affects project that:

a.) enable ``pyramid.allow_empty_pattern``, AND;
b.) mount an empty pattern under a prefix (``'/prefix'`` + ``''``), AND;
c.) expect a slash-appended route to be created (``'/prefix/'``).

Docs:

- Provided further route-prefixing design examples re sub-callables and
nested prefixes where common usage might be to prefix a locale string to
a module routes (e.g. ``/{_LOCALE_}/users/show``);

- Documented enhanced route-prefix behaviour and added advisory note for
existing projects that want to enable ``pyramid.allow_empty_pattern``.