Kaydet (Commit) e8ef80c1 authored tarafından Malcolm Tredinnick's avatar Malcolm Tredinnick

Fixed #2278 -- Fixed some argument parsing problems with the PostgreSQL

dbshell. Also added in the process name to the arg list so that the output of
'ps' looks sensible.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3278 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst c2556874
......@@ -2,13 +2,14 @@ from django.conf import settings
import os
def runshell():
args = ['']
args += ["-U%s" % settings.DATABASE_USER]
args = ['psql']
if settings.DATABASE_USER:
args += ["-U", settings.DATABASE_USER]
if settings.DATABASE_PASSWORD:
args += ["-W"]
if settings.DATABASE_HOST:
args += ["-h %s" % settings.DATABASE_HOST]
args.extend(["-h", settings.DATABASE_HOST])
if settings.DATABASE_PORT:
args += ["-p %s" % settings.DATABASE_PORT]
args.extend(["-p", str(settings.DATABASE_PORT)])
args += [settings.DATABASE_NAME]
os.execvp('psql', args)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment