diff --git a/django/db/__init__.py b/django/db/__init__.py
index 8025721..250e0a0 100644
--- a/django/db/__init__.py
+++ b/django/db/__init__.py
@@ -37,7 +37,14 @@ except ImportError, e:
             raise # If there's some other error, this must be an error in Django itself.
 
 # Convenient aliases for backend bits.
-connection = backend.DatabaseWrapper(**settings.DATABASE_OPTIONS)
+connection = backend.DatabaseWrapper({
+    'DATABASE_HOST': settings.DATABASE_HOST,
+    'DATABASE_NAME': settings.DATABASE_NAME,
+    'DATABASE_OPTIONS': settings.DATABASE_OPTIONS,
+    'DATABASE_PASSWORD': settings.DATABASE_PASSWORD,
+    'DATABASE_PORT': settings.DATABASE_PORT,
+    'DATABASE_USER': settings.DATABASE_USER,
+})
 DatabaseError = backend.DatabaseError
 IntegrityError = backend.IntegrityError
 
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index 187ff6c..1b5f265 100644
--- a/django/db/backends/__init__.py
+++ b/django/db/backends/__init__.py
@@ -24,10 +24,10 @@ class BaseDatabaseWrapper(local):
     Represents a database connection.
     """
     ops = None
-    def __init__(self, **kwargs):
+    def __init__(self, settings):
         self.connection = None
         self.queries = []
-        self.options = kwargs
+        self.settings = settings
 
     def _commit(self):
         if self.connection is not None:
@@ -59,7 +59,7 @@ class BaseDatabaseWrapper(local):
 
     def cursor(self):
         from django.conf import settings
-        cursor = self._cursor(settings)
+        cursor = self._cursor()
         if settings.DEBUG:
             return self.make_debug_cursor(cursor)
         return cursor
@@ -497,6 +497,9 @@ class BaseDatabaseClient(object):
     # This should be a string representing the name of the executable
     # (e.g., "psql"). Subclasses must override this.
     executable_name = None
+    
+    def __init__(self, connection):
+        self.connection = connection
 
     def runshell(self):
         raise NotImplementedError()
diff --git a/django/db/backends/dummy/base.py b/django/db/backends/dummy/base.py
index 530ea9c..a18c609 100644
--- a/django/db/backends/dummy/base.py
+++ b/django/db/backends/dummy/base.py
@@ -46,7 +46,7 @@ class DatabaseWrapper(object):
 
         self.features = BaseDatabaseFeatures()
         self.ops = DatabaseOperations()
-        self.client = DatabaseClient()
+        self.client = DatabaseClient(self)
         self.creation = BaseDatabaseCreation(self)
         self.introspection = DatabaseIntrospection(self)
         self.validation = BaseDatabaseValidation()
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py
index 00da726..eb6dad1 100644
--- a/django/db/backends/mysql/base.py
+++ b/django/db/backends/mysql/base.py
@@ -238,7 +238,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
 
         self.features = DatabaseFeatures()
         self.ops = DatabaseOperations()
-        self.client = DatabaseClient()
+        self.client = DatabaseClient(self)
         self.creation = DatabaseCreation(self)
         self.introspection = DatabaseIntrospection(self)
         self.validation = DatabaseValidation()
@@ -253,26 +253,26 @@ class DatabaseWrapper(BaseDatabaseWrapper):
                 self.connection = None
         return False
 
-    def _cursor(self, settings):
+    def _cursor(self):
         if not self._valid_connection():
             kwargs = {
                 'conv': django_conversions,
                 'charset': 'utf8',
                 'use_unicode': True,
             }
-            if settings.DATABASE_USER:
-                kwargs['user'] = settings.DATABASE_USER
-            if settings.DATABASE_NAME:
-                kwargs['db'] = settings.DATABASE_NAME
-            if settings.DATABASE_PASSWORD:
-                kwargs['passwd'] = settings.DATABASE_PASSWORD
-            if settings.DATABASE_HOST.startswith('/'):
-                kwargs['unix_socket'] = settings.DATABASE_HOST
-            elif settings.DATABASE_HOST:
-                kwargs['host'] = settings.DATABASE_HOST
-            if settings.DATABASE_PORT:
-                kwargs['port'] = int(settings.DATABASE_PORT)
-            kwargs.update(self.options)
+            if self.settings['DATABASE_USER']:
+                kwargs['user'] = self.settings['DATABASE_USER']
+            if self.settings['DATABASE_NAME']:
+                kwargs['db'] = self.settings['DATABASE_NAME']
+            if self.settings['DATABASE_PASSWORD']:
+                kwargs['passwd'] = self.settings['DATABASE_PASSWORD']
+            if self.settings['DATABASE_HOST'].startswith('/'):
+                kwargs['unix_socket'] = self.settings['DATABASE_HOST']
+            elif self.settings['DATABASE_HOST']:
+                kwargs['host'] = self.settings['DATABASE_HOST']
+            if self.settings['DATABASE_PORT']:
+                kwargs['port'] = int(self.settings['DATABASE_PORT'])
+            kwargs.update(self.settings['DATABASE_OPTIONS'])
             self.connection = Database.connect(**kwargs)
             self.connection.encoders[SafeUnicode] = self.connection.encoders[unicode]
             self.connection.encoders[SafeString] = self.connection.encoders[str]
diff --git a/django/db/backends/mysql/client.py b/django/db/backends/mysql/client.py
index 17daca9..d8783e0 100644
--- a/django/db/backends/mysql/client.py
+++ b/django/db/backends/mysql/client.py
@@ -1,5 +1,4 @@
 from django.db.backends import BaseDatabaseClient
-from django.conf import settings
 import os
 
 class DatabaseClient(BaseDatabaseClient):
@@ -7,12 +6,12 @@ class DatabaseClient(BaseDatabaseClient):
 
     def runshell(self):
         args = ['']
-        db = settings.DATABASE_OPTIONS.get('db', settings.DATABASE_NAME)
-        user = settings.DATABASE_OPTIONS.get('user', settings.DATABASE_USER)
-        passwd = settings.DATABASE_OPTIONS.get('passwd', settings.DATABASE_PASSWORD)
-        host = settings.DATABASE_OPTIONS.get('host', settings.DATABASE_HOST)
-        port = settings.DATABASE_OPTIONS.get('port', settings.DATABASE_PORT)
-        defaults_file = settings.DATABASE_OPTIONS.get('read_default_file')
+        db = self.connection.settings['DATABASE_OPTIONS'].get('db', self.connection.settings['DATABASE_NAME'])
+        user = self.connection.settings['DATABASE_OPTIONS'].get('user', self.connection.settings['DATABASE_USER'])
+        passwd = self.connection.settings['DATABASE_OPTIONS'].get('passwd', self.connection.settings['DATABASE_PASSWORD'])
+        host = self.connection.settings['DATABASE_OPTIONS'].get('host', self.connection.settings['DATABASE_HOST'])
+        port = self.connection.settings['DATABASE_OPTIONS'].get('port', self.connection.settings['DATABASE_PORT'])
+        defaults_file = self.connection.settings['DATABASE_OPTIONS'].get('read_default_file')
         # Seems to be no good way to set sql_mode with CLI.
     
         if defaults_file:
diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py
index baa8486..d59804a 100644
--- a/django/db/backends/oracle/base.py
+++ b/django/db/backends/oracle/base.py
@@ -262,7 +262,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
 
         self.features = DatabaseFeatures()
         self.ops = DatabaseOperations()
-        self.client = DatabaseClient()
+        self.client = DatabaseClient(self)
         self.creation = DatabaseCreation(self)
         self.introspection = DatabaseIntrospection(self)
         self.validation = BaseDatabaseValidation()
@@ -270,23 +270,23 @@ class DatabaseWrapper(BaseDatabaseWrapper):
     def _valid_connection(self):
         return self.connection is not None
 
-    def _connect_string(self, settings):
-        if len(settings.DATABASE_HOST.strip()) == 0:
-            settings.DATABASE_HOST = 'localhost'
-        if len(settings.DATABASE_PORT.strip()) != 0:
-            dsn = Database.makedsn(settings.DATABASE_HOST,
-                                   int(settings.DATABASE_PORT),
-                                   settings.DATABASE_NAME)
+    def _connect_string(self):
+        if len(self.settings['DATABASE_HOST'].strip()) == 0:
+            self.settings['DATABASE_HOST'] = 'localhost'
+        if len(self.settings['DATABASE_PORT'].strip()) != 0:
+            dsn = Database.makedsn(self.settings['DATABASE_HOST'],
+                                   int(self.settings['DATABASE_PORT']),
+                                   self.settings['DATABASE_NAME'])
         else:
-            dsn = settings.DATABASE_NAME
-        return "%s/%s@%s" % (settings.DATABASE_USER,
-                             settings.DATABASE_PASSWORD, dsn)
+            dsn = self.settings['DATABASE_NAME']
+        return "%s/%s@%s" % (self.settings['DATABASE_USER'],
+                             self.settings['DATABASE_PASSWORD'], dsn)
 
-    def _cursor(self, settings):
+    def _cursor(self):
         cursor = None
         if not self._valid_connection():
-            conn_string = self._connect_string(settings)
-            self.connection = Database.connect(conn_string, **self.options)
+            conn_string = self._connect_string()
+            self.connection = Database.connect(conn_string, **self.settings['DATABASE_OPTIONS'])
             cursor = FormatStylePlaceholderCursor(self.connection)
             # Set oracle date to ansi date format.  This only needs to execute
             # once when we create a new connection. We also set the Territory
diff --git a/django/db/backends/oracle/client.py b/django/db/backends/oracle/client.py
index c95b810..84193ea 100644
--- a/django/db/backends/oracle/client.py
+++ b/django/db/backends/oracle/client.py
@@ -1,12 +1,10 @@
 from django.db.backends import BaseDatabaseClient
-from django.conf import settings
 import os
 
 class DatabaseClient(BaseDatabaseClient):
     executable_name = 'sqlplus'
 
     def runshell(self):
-        from django.db import connection
-        conn_string = connection._connect_string(settings)
+        conn_string = self.connection._connect_string()
         args = [self.executable_name, "-L", conn_string]
         os.execvp(self.executable_name, args)
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py
index ad271f2..d4fb01b 100644
--- a/django/db/backends/postgresql/base.py
+++ b/django/db/backends/postgresql/base.py
@@ -90,28 +90,28 @@ class DatabaseWrapper(BaseDatabaseWrapper):
 
         self.features = DatabaseFeatures()
         self.ops = DatabaseOperations()
-        self.client = DatabaseClient()
+        self.client = DatabaseClient(self)
         self.creation = DatabaseCreation(self)
         self.introspection = DatabaseIntrospection(self)
         self.validation = BaseDatabaseValidation()
 
-    def _cursor(self, settings):
+    def _cursor(self):
         set_tz = False
         if self.connection is None:
             set_tz = True
-            if settings.DATABASE_NAME == '':
+            if self.settings['DATABASE_NAME'] == '':
                 from django.core.exceptions import ImproperlyConfigured
                 raise ImproperlyConfigured("You need to specify DATABASE_NAME in your Django settings file.")
-            conn_string = "dbname=%s" % settings.DATABASE_NAME
-            if settings.DATABASE_USER:
-                conn_string = "user=%s %s" % (settings.DATABASE_USER, conn_string)
-            if settings.DATABASE_PASSWORD:
-                conn_string += " password='%s'" % settings.DATABASE_PASSWORD
-            if settings.DATABASE_HOST:
-                conn_string += " host=%s" % settings.DATABASE_HOST
-            if settings.DATABASE_PORT:
-                conn_string += " port=%s" % settings.DATABASE_PORT
-            self.connection = Database.connect(conn_string, **self.options)
+            conn_string = "dbname=%s" % self.settings['DATABASE_NAME']
+            if self.settings['DATABASE_USER']:
+                conn_string = "user=%s %s" % (self.settings['DATABASE_USER'], conn_string)
+            if self.settings['DATABASE_PASSWORD']:
+                conn_string += " password='%s'" % self.settings['DATABASE_PASSWORD']
+            if self.settings['DATABASE_HOST']:
+                conn_string += " host=%s" % self.settings['DATABASE_HOST']
+            if self.settings['DATABASE_PORT']:
+                conn_string += " port=%s" % self.settings['DATABASE_PORT']
+            self.connection = Database.connect(conn_string, **self.settings['DATABASE_OPTIONS'])
             self.connection.set_isolation_level(1) # make transactions transparent to all cursors
         cursor = self.connection.cursor()
         if set_tz:
diff --git a/django/db/backends/postgresql/client.py b/django/db/backends/postgresql/client.py
index 63f28a7..3e51423 100644
--- a/django/db/backends/postgresql/client.py
+++ b/django/db/backends/postgresql/client.py
@@ -1,5 +1,4 @@
 from django.db.backends import BaseDatabaseClient
-from django.conf import settings
 import os
 
 class DatabaseClient(BaseDatabaseClient):
@@ -7,13 +6,13 @@ class DatabaseClient(BaseDatabaseClient):
 
     def runshell(self):
         args = [self.executable_name]
-        if settings.DATABASE_USER:
-            args += ["-U", settings.DATABASE_USER]
-        if settings.DATABASE_PASSWORD:
+        if self.connection.settings['DATABASE_USER']:
+            args += ["-U", self.connection.settings['DATABASE_USER']]
+        if self.connection.settings['DATABASE_PASSWORD']:
             args += ["-W"]
-        if settings.DATABASE_HOST:
-            args.extend(["-h", settings.DATABASE_HOST])
-        if settings.DATABASE_PORT:
-            args.extend(["-p", str(settings.DATABASE_PORT)])
-        args += [settings.DATABASE_NAME]
+        if self.connection.settings['DATABASE_HOST']:
+            args.extend(["-h", self.connection.settings['DATABASE_HOST']])
+        if self.connection.settings['DATABASE_PORT']:
+            args.extend(["-p", str(self.connection.settings['DATABASE_PORT'])])
+        args += [self.connection.settings['DATABASE_NAME']]
         os.execvp(self.executable_name, args)
diff --git a/django/db/backends/postgresql_psycopg2/base.py b/django/db/backends/postgresql_psycopg2/base.py
index 27de942..76aaf96 100644
--- a/django/db/backends/postgresql_psycopg2/base.py
+++ b/django/db/backends/postgresql_psycopg2/base.py
@@ -60,30 +60,30 @@ class DatabaseWrapper(BaseDatabaseWrapper):
         
         self.features = DatabaseFeatures()
         self.ops = DatabaseOperations()
-        self.client = DatabaseClient()
+        self.client = DatabaseClient(self)
         self.creation = DatabaseCreation(self)
         self.introspection = DatabaseIntrospection(self)
         self.validation = BaseDatabaseValidation()
 
-    def _cursor(self, settings):
+    def _cursor(self):
         set_tz = False
         if self.connection is None:
             set_tz = True
-            if settings.DATABASE_NAME == '':
+            if self.settings['DATABASE_NAME'] == '':
                 from django.core.exceptions import ImproperlyConfigured
                 raise ImproperlyConfigured("You need to specify DATABASE_NAME in your Django settings file.")
             conn_params = {
-                'database': settings.DATABASE_NAME,
+                'database': self.settings['DATABASE_NAME'],
             }
-            conn_params.update(self.options)
-            if settings.DATABASE_USER:
-                conn_params['user'] = settings.DATABASE_USER
-            if settings.DATABASE_PASSWORD:
-                conn_params['password'] = settings.DATABASE_PASSWORD
-            if settings.DATABASE_HOST:
-                conn_params['host'] = settings.DATABASE_HOST
-            if settings.DATABASE_PORT:
-                conn_params['port'] = settings.DATABASE_PORT
+            conn_params.update(self.settings['DATABASE_OPTIONS'])
+            if self.settings['DATABASE_USER']:
+                conn_params['user'] = self.settings['DATABASE_USER']
+            if self.settings['DATABASE_PASSWORD']:
+                conn_params['password'] = self.settings['DATABASE_PASSWORD']
+            if self.settings['DATABASE_HOST']:
+                conn_params['host'] = self.settings['DATABASE_HOST']
+            if self.settings['DATABASE_PORT']:
+                conn_params['port'] = self.settings['DATABASE_PORT']
             self.connection = Database.connect(**conn_params)
             self.connection.set_isolation_level(1) # make transactions transparent to all cursors
             self.connection.set_client_encoding('UTF8')
diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py
index ba0ef16..e1f6732 100644
--- a/django/db/backends/sqlite3/base.py
+++ b/django/db/backends/sqlite3/base.py
@@ -149,21 +149,21 @@ class DatabaseWrapper(BaseDatabaseWrapper):
 
         self.features = DatabaseFeatures()
         self.ops = DatabaseOperations()
-        self.client = DatabaseClient()
+        self.client = DatabaseClient(self)
         self.creation = DatabaseCreation(self)
         self.introspection = DatabaseIntrospection(self)
         self.validation = BaseDatabaseValidation()
 
-    def _cursor(self, settings):
+    def _cursor(self):
         if self.connection is None:
-            if not settings.DATABASE_NAME:
+            if not self.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,
+                'database': self.settings['DATABASE_NAME'],
                 'detect_types': Database.PARSE_DECLTYPES | Database.PARSE_COLNAMES,
             }
-            kwargs.update(self.options)
+            kwargs.update(self.settings['DATABASE_OPTIONS'])
             self.connection = Database.connect(**kwargs)
             # Register extract, date_trunc, and regexp functions.
             self.connection.create_function("django_extract", 2, _sqlite_extract)
@@ -172,11 +172,10 @@ class DatabaseWrapper(BaseDatabaseWrapper):
         return self.connection.cursor(factory=SQLiteCursorWrapper)
 
     def close(self):
-        from django.conf import settings
         # If database is in memory, closing the connection destroys the
         # database. To prevent accidental data loss, ignore close requests on
         # an in-memory db.
-        if settings.DATABASE_NAME != ":memory:":
+        if self.settings['DATABASE_NAME'] != ":memory:":
             BaseDatabaseWrapper.close(self)
 
 class SQLiteCursorWrapper(Database.Cursor):
diff --git a/django/db/backends/sqlite3/client.py b/django/db/backends/sqlite3/client.py
index 239e72f..5b40ffb 100644
--- a/django/db/backends/sqlite3/client.py
+++ b/django/db/backends/sqlite3/client.py
@@ -1,10 +1,9 @@
 from django.db.backends import BaseDatabaseClient
-from django.conf import settings
 import os
 
 class DatabaseClient(BaseDatabaseClient):
     executable_name = 'sqlite3'
 
     def runshell(self):
-        args = ['', settings.DATABASE_NAME]
+        args = ['', self.connection.settings['DATABASE_NAME']]
         os.execvp(self.executable_name, args)
