-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_db.py
39 lines (33 loc) · 1.24 KB
/
build_db.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
28
29
30
31
32
33
34
35
36
37
38
39
"""
This module can build a new socketio_printer according to the structure defined in the 'socketio_printer' module.
"""
__author__ = "Marc Bermejo"
__credits__ = ["Marc Bermejo"]
__license__ = "GPL-3.0"
__version__ = "0.0.2"
__maintainer__ = "Marc Bermejo"
__email__ = "[email protected]"
__status__ = "Development"
import os
if __name__ == '__main__':
from flask import Flask
app = Flask(__name__, instance_relative_config=True)
env = os.getenv("ENV", "production")
if env == "development":
# Load the instance development config
app.config.from_object("instance.development.Config")
elif env == "staging":
# Load the instance staging config
app.config.from_object("instance.staging.Config")
elif env == "production":
# Load the instance production config
app.config.from_object("instance.production.Config")
elif env == "production-dds":
# Load the instance production config for the DDS servers
app.config.from_object("instance.production-dds.Config")
else:
raise RuntimeError("Unknown environment '{}'".format(env))
app.app_context().push()
from queuemanager.database import init_app, init_db
init_app(app)
init_db(app)