Generated correct admindocs URLs on Python 3. URLs generate 404s on
Python 2, as in older versions of Django.
Backport of bc1e2d8e8edde6cc7d2657c68242a13ee65a15b8 from master
Fixed a regression in 625b8e9295d79650208bfb3fca8bf9e6aaf578e4:
improper short-circuiting could lead to a KeyError when threads
concurrently call RegexURLResolver._populate().
Backport of 389a5318a06e7e4d8f8aba14af88c4cc4ea0db47 from master
It was removed in 785cc71d5b3300e2702b0b2fc7316e58ca70b563 only because
it was untested and unused in Django itself, however, some third-party
apps use it.
Backport of 4e400dcb79bc468ee1ff899312a00ed8dc3e795c from master
Fixed a regression in 2f16ff5a6cbd71fc6c50e88e4087f3657222e90e.
Thanks Tim Graham for the review.
Backport of 625b8e9295d79650208bfb3fca8bf9e6aaf578e4 from master
Made URL application namespaces be set in the included URLconf and
instance namespaces in the call to include(). Deprecated other ways
to set application and instance namespaces.
When reversing, only outer parameters are used if captured parameters are
nested. Added tests to check the edge cases and documentation for the
behavior with an example to avoid it.
Tests were using an undocumented keyword argument for easily overriding
script prefix while reversing. This is now changed into a test utility
which can be used as decorator or context manager.
Prefix was treated as a part of the url pattern, which it is not.
Improved tests to conform with RFC 3986 which allows certain
characters in path segments without being escaped.
Propagated unnamed arguments as positional arguments into included
URLconfs if no named arguments are defined. Positional and keyword
arguments are never combined.
And follow more closely the class of characters defined in the
RFC 3986.
Thanks Erik van Zijst for the report and the initial patch, and
Tim Graham for the review.
- Fixed bug in get_callable() that caused resolve() to put a string
in ResolverMatch.func.
- Made ResolverMatch.url_name match the actual url name (or None).
- Updated tests that used the string value in ResolverMatch.func, and
added regression tests for this bug.
- Corrected test urls whose dummy view paths caused failures (behavior
that was previously masked by this bug).