summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/utils/autoreload.py7
-rw-r--r--docs/releases/2.2.1.txt3
2 files changed, 9 insertions, 1 deletions
diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py
index d43342c2d7..556b179774 100644
--- a/django/utils/autoreload.py
+++ b/django/utils/autoreload.py
@@ -269,7 +269,12 @@ class BaseReloader:
from django.urls import get_resolver
# Prevent a race condition where URL modules aren't loaded when the
# reloader starts by accessing the urlconf_module property.
- get_resolver().urlconf_module
+ try:
+ get_resolver().urlconf_module
+ except Exception:
+ # Loading the urlconf can result in errors during development.
+ # If this occurs then swallow the error and continue.
+ pass
logger.debug('Apps ready_event triggered. Sending autoreload_started signal.')
autoreload_started.send(sender=self)
self.run_loop()
diff --git a/docs/releases/2.2.1.txt b/docs/releases/2.2.1.txt
index 9696488e14..4a2d77aaf3 100644
--- a/docs/releases/2.2.1.txt
+++ b/docs/releases/2.2.1.txt
@@ -64,3 +64,6 @@ Bugfixes
permissions for proxy models if the target permissions already existed. For
example, when a permission had been created manually or a model had been
migrated from concrete to proxy (:ticket:`30351`).
+
+* Fixed a regression in Django 2.2 that caused a crash of :djadmin:`runserver`
+ when URLConf modules raised exceptions (:ticket:`30323`).