diff options
author | 2016-11-28 08:27:25 +0000 | |
---|---|---|
committer | 2016-11-28 08:27:25 +0000 | |
commit | 57e5b616ddbb32f87c660269642b8da86b30b3c1 (patch) | |
tree | 3e392065db1f2e8862051b0956ad9ade7a621bf6 /dashboard/backend/wsgi.py | |
parent | 042dcda01c51493eda99b7a835cdbd59c1ae12b0 (diff) | |
parent | 68fde29bdcfe0b206f588dab85e5b7d8ac9449f4 (diff) |
Merge "Backend rest api mechanism"
Diffstat (limited to 'dashboard/backend/wsgi.py')
-rwxr-xr-x | dashboard/backend/wsgi.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/dashboard/backend/wsgi.py b/dashboard/backend/wsgi.py new file mode 100755 index 00000000..088299d7 --- /dev/null +++ b/dashboard/backend/wsgi.py @@ -0,0 +1,35 @@ +##############################################################################
+# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+from dovetail.utils import flags
+from dovetail.utils import logsetting
+from dovetail.utils import setting_wrapper as setting
+
+from dovetail.api.api import app
+
+import os
+import logging
+
+gunicorn_error_logger = logging.getLogger('gunicorn.error')
+app.logger.handlers.extend(gunicorn_error_logger.handlers)
+app.logger.setLevel(logging.DEBUG)
+
+# flags.init()
+# logdir = setting.DEFAULT_LOGDIR
+curr_path = os.path.dirname(os.path.abspath(__file__))
+logdir = os.path.join(curr_path, 'log')
+if not os.path.exists(logdir):
+ os.makedirs(logdir)
+
+flags.OPTIONS.logdir = logdir
+flags.OPTIONS.logfile = setting.WEB_LOGFILE
+logsetting.init()
+
+
+if __name__ == "__main__":
+ app.run()
|