make init_db less verbose
This commit is contained in:
parent
c8c5e25a65
commit
5dc7564b4f
1 changed files with 7 additions and 3 deletions
|
@ -7,17 +7,21 @@ import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
def run(cmd):
|
def run(cmd):
|
||||||
r = subprocess.call(cmd)
|
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
if r != 0:
|
stdout, stderr = p.communicate()
|
||||||
|
|
||||||
|
if p.returncode != 0:
|
||||||
|
print stderr
|
||||||
sys.exit(r)
|
sys.exit(r)
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
"""
|
"""
|
||||||
"""
|
"""
|
||||||
help = 'initialize pan.do/ra db'
|
help = 'initialize database'
|
||||||
args = ''
|
args = ''
|
||||||
|
|
||||||
def handle(self, **options):
|
def handle(self, **options):
|
||||||
|
print 'initializing database...'
|
||||||
manage_py = sys.argv[0]
|
manage_py = sys.argv[0]
|
||||||
for cmd in [
|
for cmd in [
|
||||||
[manage_py, 'syncdb', '--noinput'],
|
[manage_py, 'syncdb', '--noinput'],
|
||||||
|
|
Loading…
Reference in a new issue