2020-08-13 17:48:26 +00:00
|
|
|
#!/usr/bin/python3
|
2020-09-07 14:07:35 +00:00
|
|
|
from flaschengeist.app import create_app
|
2020-09-03 15:56:42 +00:00
|
|
|
import bjoern
|
|
|
|
import argparse
|
2019-01-13 19:07:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2020-09-03 15:56:42 +00:00
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
parser.add_argument("--host", help="set hostname to listen on", default="127.0.0.1")
|
|
|
|
parser.add_argument("--port", help="set port to listen on", type=int, default=5000)
|
|
|
|
parser.add_argument("--debug", help="run in debug mode", action="store_true")
|
2020-10-03 23:29:49 +00:00
|
|
|
parser.add_argument("--install", help="installer", action="store_true")
|
2020-09-03 15:56:42 +00:00
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
app = create_app()
|
2020-10-03 23:29:49 +00:00
|
|
|
if args.install:
|
|
|
|
with app.app_context():
|
|
|
|
from flaschengeist.system.models import *
|
|
|
|
from flaschengeist.system.database import db
|
|
|
|
db.create_all()
|
|
|
|
db.session.commit()
|
2020-09-03 15:56:42 +00:00
|
|
|
else:
|
2020-10-03 23:29:49 +00:00
|
|
|
if args.debug:
|
|
|
|
app.run(args.host, args.port, debug=True)
|
|
|
|
else:
|
|
|
|
bjoern.run(app, args.host, args.port, reuse_port=True)
|