Ticket #5552: requiredsqlitedatabasename.patch

File requiredsqlitedatabasename.patch, 703 bytes (added by floguy, 17 years ago)

Patch to fix this problem. Raises ImproperlyConfigured if there is no DATABASE_NAME.

  • trunk/django/db/backends/sqlite3/base.py

    === modified file 'trunk/django/db/backends/sqlite3/base.py'
     
    102102
    103103    def _cursor(self, settings):
    104104        if self.connection is None:
     105            if not settings.DATABASE_NAME:
     106                from django.core.exceptions import ImproperlyConfigured
     107                raise ImproperlyConfigured, "Please fill out DATABASE_NAME in the settings module before using the database."
    105108            kwargs = {
    106109                'database': settings.DATABASE_NAME,
    107110                'detect_types': Database.PARSE_DECLTYPES | Database.PARSE_COLNAMES,
Back to Top