forked from megalis-bretagne/opendata-extraction
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage.py
27 lines (22 loc) · 908 Bytes
/
manage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""This file sets up a command line manager.
Use "python manage.py" for a list of available commands.
Use "python manage.py runserver" to start the development web server on localhost:5000.
Use "python manage.py runserver --help" for a list of runserver options.
"""
import sys
from app import create_app
from flask_script import Manager
from app.commands import InitDbCommand,WatcherCommand
# Setup Flask-Script with command line commands
print(sys.argv)
if sys.argv[1] != 'runserver':
manager = Manager(create_app(oidcEnable=False))
else:
manager = Manager(create_app)
#manager.add_command('db', Migrate)
manager.add_command('init_db', InitDbCommand)
manager.add_command('watcher', WatcherCommand)
if __name__ == "__main__":
# python manage.py # shows available commands
# python manage.py runserver --help # shows available runserver options
manager.run()