diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py index 5cb21f5e3b..48d9ad4c4b 100644 --- a/django/db/backends/sqlite3/base.py +++ b/django/db/backends/sqlite3/base.py @@ -110,6 +110,9 @@ class DatabaseWrapper(BaseDatabaseWrapper): def _cursor(self, settings): if self.connection is None: + if not settings.DATABASE_NAME: + from django.core.exceptions import ImproperlyConfigured + raise ImproperlyConfigured, "Please fill out DATABASE_NAME in the settings module before using the database." kwargs = { 'database': settings.DATABASE_NAME, 'detect_types': Database.PARSE_DECLTYPES | Database.PARSE_COLNAMES,