|
@ -1,5 +1,6 @@ |
|
|
import argparse |
|
|
import argparse |
|
|
import os |
|
|
import os |
|
|
|
|
|
import sys |
|
|
import subprocess |
|
|
import subprocess |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -19,19 +20,19 @@ def main(): |
|
|
print('Setup Database.') |
|
|
print('Setup Database.') |
|
|
base = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) |
|
|
base = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) |
|
|
manage_path = os.path.join(base, 'manage.py') |
|
|
manage_path = os.path.join(base, 'manage.py') |
|
|
subprocess.call(['python', manage_path, 'wait_for_db'], shell=False) |
|
|
|
|
|
subprocess.call(['python', manage_path, 'migrate'], shell=False) |
|
|
|
|
|
subprocess.call(['python', manage_path, 'create_roles'], shell=False) |
|
|
|
|
|
|
|
|
subprocess.call([sys.executable, manage_path, 'wait_for_db'], shell=False) |
|
|
|
|
|
subprocess.call([sys.executable, manage_path, 'migrate'], shell=False) |
|
|
|
|
|
subprocess.call([sys.executable, manage_path, 'create_roles'], shell=False) |
|
|
|
|
|
|
|
|
print('Create admin user.') |
|
|
print('Create admin user.') |
|
|
subprocess.call(['python', manage_path, 'create_admin', |
|
|
|
|
|
|
|
|
subprocess.call([sys.executable, manage_path, 'create_admin', |
|
|
'--username', args.username, |
|
|
'--username', args.username, |
|
|
'--password', args.password, |
|
|
'--password', args.password, |
|
|
'--email', args.email, |
|
|
'--email', args.email, |
|
|
'--noinput'], shell=False) |
|
|
'--noinput'], shell=False) |
|
|
|
|
|
|
|
|
print(f'Starting server with port {args.port}.') |
|
|
print(f'Starting server with port {args.port}.') |
|
|
subprocess.call(['python', manage_path, 'runserver', f'0.0.0.0:{args.port}']) |
|
|
|
|
|
|
|
|
subprocess.call([sys.executable, manage_path, 'runserver', f'0.0.0.0:{args.port}']) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
if __name__ == '__main__': |
|
|