|
|
@ -4,14 +4,18 @@ import subprocess |
|
|
|
|
|
|
|
|
|
|
|
def main(): |
|
|
|
parser = argparse.ArgumentParser(prog='gfg', description='GfG article demo package.') |
|
|
|
parser.add_argument('--username', type=str, default='admin') |
|
|
|
parser.add_argument('--password', type=str, default='password') |
|
|
|
parser.add_argument('--email', type=str, default='example@example.com') |
|
|
|
parser.add_argument('--port', type=int, default=8000) |
|
|
|
parser.add_argument('--workers', type=int, default=1) |
|
|
|
parser = argparse.ArgumentParser(description='doccano.') |
|
|
|
parser.add_argument('--username', type=str, default='admin', help='admin username') |
|
|
|
parser.add_argument('--password', type=str, default='password', help='admin password') |
|
|
|
parser.add_argument('--email', type=str, default='example@example.com', help='admin email') |
|
|
|
parser.add_argument('--port', type=int, default=8000, help='port') |
|
|
|
parser.add_argument('--workers', type=int, default=1, help='workers') |
|
|
|
parser.add_argument('--database_url', type=str, default='sqlite:///doccano.db', help='data store') |
|
|
|
args = parser.parse_args() |
|
|
|
|
|
|
|
os.environ.setdefault('DEBUG', 'False') |
|
|
|
os.environ.setdefault('DATABASE_URL', args.database_url) |
|
|
|
|
|
|
|
print('Setup Database.') |
|
|
|
base = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) |
|
|
|
manage_path = os.path.join(base, 'manage.py') |
|
|
@ -27,7 +31,6 @@ def main(): |
|
|
|
'--noinput'], shell=False) |
|
|
|
|
|
|
|
print(f'Starting server with port {args.port}.') |
|
|
|
os.environ['DEBUG'] = 'False' |
|
|
|
subprocess.call(['python', manage_path, 'runserver', f'0.0.0.0:{args.port}']) |
|
|
|
|
|
|
|
|
|
|
|