aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2016-05-06 15:37:15 +0300
committerFilipp Lepalaan <filipp@mac.com>2016-05-06 15:37:15 +0300
commit11e9f35220017062d2d09649354174c955f3caa0 (patch)
tree83c87c976450902fff5c208f8ef698d9b96bff7c
parent25da91da35400e0a9e70ca7a6f91e4eea90ad61a (diff)
downloadServo-11e9f35220017062d2d09649354174c955f3caa0.tar.gz
Servo-11e9f35220017062d2d09649354174c955f3caa0.tar.bz2
Servo-11e9f35220017062d2d09649354174c955f3caa0.zip
Prompt for dbadmin
-rwxr-xr-xinstall.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/install.py b/install.py
index 60170c0..9d12b45 100755
--- a/install.py
+++ b/install.py
@@ -13,6 +13,7 @@ fh = open('local_settings.py', 'w')
print("** Creating local configuration file **")
args = {}
+args['dbadmin'] = raw_input('DB admin username [pgsql]: ') or 'pgsql'
args['secret_key'] = os.urandom(32).encode('base-64').strip()
args['install_locale'] = raw_input('1/10 Locale [sv_SE.UTF-8]: ') or 'sv_SE.UTF-8'
default_country = args['install_locale'].split('_')[0]
@@ -32,8 +33,8 @@ template = Template(raw)
s = template.substitute(**args)
-call(['createuser', args['dbuser'], '-U', 'pgsql'])
-call(['createdb', args['dbname'], '-O', args['dbuser'], '-U', 'pgsql'])
+call(['createuser', args['dbuser'], '-U', args['dbadmin']])
+call(['createdb', args['dbname'], '-O', args['dbuser'], '-U', args['dbadmin']])
fh.write(s)
fh.close()
@@ -41,8 +42,8 @@ fh.close()
loc = {}
print("** Setting up database tables **")
-call(['./manage.py', 'migrate', '--no-initial-data'])
-call(['psql', '-c', 'ALTER SEQUENCE servo_order_id_seq RESTART WITH 12345'])
+call(['./manage.py', 'migrate'])
+call(['psql', '-c', 'ALTER SEQUENCE servo_order_id_seq RESTART WITH 12345', args['dbname'], args['dbuser']])
print("** Creating Super User **")
call(['./manage.py', 'createsuperuser'])