diff --git a/app/doccano/doccano.py b/app/doccano/doccano.py index c6f0a610..c5bae1ed 100644 --- a/app/doccano/doccano.py +++ b/app/doccano/doccano.py @@ -1,5 +1,6 @@ import argparse import os +import sys import subprocess @@ -19,19 +20,19 @@ def main(): print('Setup Database.') base = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) 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.') - subprocess.call(['python', manage_path, 'create_admin', + subprocess.call([sys.executable, manage_path, 'create_admin', '--username', args.username, '--password', args.password, '--email', args.email, '--noinput'], shell=False) 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__':