mirror of
https://github.com/django/django.git
synced 2025-08-05 19:38:21 +00:00
Fixed #10357 -- Fixed the "dbshell" command for Windows users.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10517 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
0d2cf7bdd6
commit
d18f75af44
4 changed files with 36 additions and 11 deletions
|
@ -1,5 +1,7 @@
|
|||
from django.db.backends import BaseDatabaseClient
|
||||
import os
|
||||
import sys
|
||||
|
||||
from django.db.backends import BaseDatabaseClient
|
||||
|
||||
class DatabaseClient(BaseDatabaseClient):
|
||||
executable_name = 'psql'
|
||||
|
@ -14,4 +16,8 @@ class DatabaseClient(BaseDatabaseClient):
|
|||
if settings_dict['DATABASE_PORT']:
|
||||
args.extend(["-p", str(settings_dict['DATABASE_PORT'])])
|
||||
args += [settings_dict['DATABASE_NAME']]
|
||||
os.execvp(self.executable_name, args)
|
||||
if os.name == 'nt':
|
||||
sys.exit(os.system(" ".join(args)))
|
||||
else:
|
||||
os.execvp(self.executable_name, args)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue