diff --git a/django/db/__init__.py b/django/db/__init__.py index 6f6e3ba6ed..641db6c012 100644 --- a/django/db/__init__.py +++ b/django/db/__init__.py @@ -97,7 +97,8 @@ class ConnectionInfo(object): def runshell(self): __import__('django.db.backends.%s.client' % - self.settings.DATABASE_ENGINE, '', '', ['']).runshell() + self.settings.DATABASE_ENGINE, '', '', [''] + ).runshell(self.settings) def reset_queries(self): """Reset log of queries executed by connection""" diff --git a/django/db/backends/ado_mssql/client.py b/django/db/backends/ado_mssql/client.py index 5c197cafa4..a5bd617ff1 100644 --- a/django/db/backends/ado_mssql/client.py +++ b/django/db/backends/ado_mssql/client.py @@ -1,2 +1,2 @@ -def runshell(): +def runshell(settings): raise NotImplementedError diff --git a/django/db/backends/mysql/client.py b/django/db/backends/mysql/client.py index f9d6297b8e..917437e81c 100644 --- a/django/db/backends/mysql/client.py +++ b/django/db/backends/mysql/client.py @@ -1,7 +1,6 @@ -from django.conf import settings import os -def runshell(): +def runshell(settings): args = [''] args += ["--user=%s" % settings.DATABASE_USER] if settings.DATABASE_PASSWORD: diff --git a/django/db/backends/oracle/client.py b/django/db/backends/oracle/client.py index 7e32ebef2f..48954fe790 100644 --- a/django/db/backends/oracle/client.py +++ b/django/db/backends/oracle/client.py @@ -1,7 +1,6 @@ -from django.conf import settings import os -def runshell(): +def runshell(settings): args = '' args += settings.DATABASE_USER if settings.DATABASE_PASSWORD: diff --git a/django/db/backends/postgresql/client.py b/django/db/backends/postgresql/client.py index 8123ec7848..38428a9c62 100644 --- a/django/db/backends/postgresql/client.py +++ b/django/db/backends/postgresql/client.py @@ -1,7 +1,6 @@ -from django.conf import settings import os -def runshell(): +def runshell(settings): args = ['psql'] if settings.DATABASE_USER: args += ["-U", settings.DATABASE_USER] diff --git a/django/db/backends/sqlite3/client.py b/django/db/backends/sqlite3/client.py index 097218341f..43978da0be 100644 --- a/django/db/backends/sqlite3/client.py +++ b/django/db/backends/sqlite3/client.py @@ -1,6 +1,5 @@ -from django.conf import settings import os -def runshell(): +def runshell(settings): args = ['', settings.DATABASE_NAME] os.execvp('sqlite3', args)