From 436ef181f33397a8c55fd3b626065a31cbc8d844 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Fri, 18 Jul 2008 22:36:31 +0000 Subject: [PATCH] Fixed #5552 -- Raise an error, rather than failing silently, when DATABASE_NAME is not specified for SQLite. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7956 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/backends/sqlite3/base.py | 3 +++ 1 file changed, 3 insertions(+) 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,