diff options
author | Filipp Lepalaan <filipp@mac.com> | 2016-05-06 15:37:15 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2016-05-06 15:37:15 +0300 |
commit | 11e9f35220017062d2d09649354174c955f3caa0 (patch) | |
tree | 83c87c976450902fff5c208f8ef698d9b96bff7c | |
parent | 25da91da35400e0a9e70ca7a6f91e4eea90ad61a (diff) | |
download | Servo-11e9f35220017062d2d09649354174c955f3caa0.tar.gz Servo-11e9f35220017062d2d09649354174c955f3caa0.tar.bz2 Servo-11e9f35220017062d2d09649354174c955f3caa0.zip |
Prompt for dbadmin
-rwxr-xr-x | install.py | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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']) |