from django.apps import AppConfig import subprocess import sys import os path = os.path.dirname(os.path.abspath(__file__)) + "/assets/bots/geoffrey.py" class GeoffreyAppConfig(AppConfig): name = 'GeoffreyApp' verbose_name = "Geoffrey: Minecraft Web Database" def ready(self): subprocess.run('screen -X -S "{0}" quit'.format("geoffrey"), shell=True) print('screen -S geoffrey -d -m {} {}'.format(sys.executable, path)) subprocess.run( 'screen -S geoffrey -d -m {} {}'.format(sys.executable, path), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)