Fixed #14200 -- Added a fallback if HttpRequest.urlconf is None.

Made BaseHandler fall back to settings.ROOT_URLCONF if
HttpRequest.urlconf is set to None, rather than raising
ImproperlyConfigured.
This commit is contained in:
Marten Kenbeek 2015-06-20 13:05:35 +02:00 committed by Tim Graham
parent 74402a5b0d
commit 738c0de300
5 changed files with 28 additions and 6 deletions

View file

@ -184,6 +184,14 @@ All attributes should be considered read-only, unless stated otherwise below.
URLconf for the current request, overriding the :setting:`ROOT_URLCONF`
setting. See :ref:`how-django-processes-a-request` for details.
``urlconf`` can be set to ``None`` to revert any changes made by previous
middleware and return to using the :setting:`ROOT_URLCONF`.
.. versionchanged:: 1.9
Setting ``urlconf=None`` raised
:exc:`~django.core.exceptions.ImproperlyConfigured` in older versions.
.. attribute:: HttpRequest.resolver_match
An instance of :class:`~django.core.urlresolvers.ResolverMatch` representing