From f0f1ba75b090e533c1b39f516cea2d9a15307ac3 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Wed, 12 Feb 2014 19:09:30 +0000 Subject: [PATCH] Fixed #21856: Don't crash runserver when DATABASES = {} --- django/core/management/commands/runserver.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py index e85aa88c3ef3d..28c6337a43367 100644 --- a/django/core/management/commands/runserver.py +++ b/django/core/management/commands/runserver.py @@ -14,6 +14,7 @@ from django.db.migrations.executor import MigrationExecutor from django.utils import autoreload from django.utils import six +from django.core.exceptions import ImproperlyConfigured naiveip_re = re.compile(r"""^(?: (?P @@ -101,7 +102,10 @@ def inner_run(self, *args, **options): self.stdout.write("Performing system checks...\n\n") self.validate(display_num_errors=True) - self.check_migrations() + try: + self.check_migrations() + except ImproperlyConfigured: + pass now = datetime.now().strftime('%B %d, %Y - %X') if six.PY2: now = now.decode('utf-8')