Browse Source

Fix cli

pull/1529/head
Hironsan 3 years ago
parent
commit
13b9947b76
1 changed files with 3 additions and 4 deletions
  1. 7
      backend/cli.py

7
backend/cli.py

@ -6,8 +6,8 @@ import subprocess
import sys
from .app.celery import app
base = os.path.abspath(os.path.dirname(__file__))
sys.path.append(base)
manage_path = os.path.join(base, 'manage.py')
parser = argparse.ArgumentParser(description='doccano, text annotation for machine learning practitioners.')
@ -16,7 +16,7 @@ def number_of_workers():
return (multiprocessing.cpu_count() * 2) + 1
def run_on_windows(args):
def run_on_nix(args):
import gunicorn.app.base
import gunicorn.util
@ -33,7 +33,6 @@ def run_on_windows(args):
self.cfg.set(key.lower(), value)
def load(self):
sys.path.append(base)
return gunicorn.util.import_app('app.wsgi')
options = {
@ -44,7 +43,7 @@ def run_on_windows(args):
StandaloneApplication(options).run()
def run_on_nix(args):
def run_on_windows(args):
from waitress import serve
from app.wsgi import application
serve(application, port=args.port)

Loading…
Cancel
Save