Skip to content

Commit

Permalink
Start kolibri via CLI entry point to ensure services etc are run
Browse files Browse the repository at this point in the history
  • Loading branch information
jamalex committed Jun 15, 2019
1 parent 8ce4070 commit 1e996ed
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,16 @@ def get_home_folder():


def start_django():
import django
django.setup()

from django.conf import settings
settings.DEBUG = False

logging.info("Preparing Kolibri for launch...")
from django.core.management import call_command
call_command("migrate", interactive=False, database="default")

call_command("collectstatic", interactive=False)

# remove this after Kolibri no longer needs it
if sys.version[0] == '2':
if sys.version[0] == "2":
reload(sys)
sys.setdefaultencoding('utf8')
sys.setdefaultencoding("utf8")

logging.info("Starting server...")
# from kolibri.utils.server import run_server
# run_server(5000)
from kolibri.utils.server import start
start(port=5000)
from kolibri.utils.cli import main

main(["start", "--foreground", "--port=5000"])


class Application(pew.ui.PEWApp):
Expand Down

0 comments on commit 1e996ed

Please sign in to comment.