Ticket #12661: environ.diff

File environ.diff, 736 bytes (added by Kyle Fuller, 14 years ago)
  • django/db/__init__.py

    diff --git a/django/db/__init__.py b/django/db/__init__.py
    index ea353e4..e4115ba 100644
    a b  
     1import os
     2
    13from django.conf import settings
    24from django.core import signals
    35from django.core.exceptions import ImproperlyConfigured
    from django.utils.functional import curry  
    79__all__ = ('backend', 'connection', 'connections', 'DatabaseError',
    810    'IntegrityError', 'DEFAULT_DB_ALIAS')
    911
    10 DEFAULT_DB_ALIAS = 'default'
     12if os.environ.has_key('DJANGO_DEFAULT_DB'):
     13    DEFAULT_DB_ALIAS = os.environ['DJANGO_DEFAULT_DB']
     14else:
     15    DEFAULT_DB_ALIAS = 'default'
    1116
    1217# For backwards compatibility - Port any old database settings over to
    1318# the new values.
Back to Top