Skip to content
Snippets Groups Projects
Commit b4a85368 authored by Michael Kyriakou's avatar Michael Kyriakou
Browse files

Refactored warning prints in app.py.

parent 81c4296c
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ from flask_migrate import Migrate
from flask import Flask, send_from_directory, request, redirect
from flask_cors import CORS
from flask_compress import Compress
from utils import DebugUtils
from database.db import lookup_db_for_binding, init_all_dbs_with_app, init_binding_to_db_for_bindings
from config.config import DEBUG_MODE, get_app_config, get_static_url
......@@ -82,8 +83,8 @@ if not MIGRATION_MODE:
handle_cli(app, lookup_db_for_binding, cli_args)
exit(1)
else:
print("!!!WARNING!!! Application should not be run with CLI arguments, "
"if you intended to run the CLI please run in development mode.")
DebugUtils.print_warning("Production application should not be run with CLI arguments, "
"if you intended to run the CLI please run in development mode.")
exit(-1)
......@@ -115,7 +116,8 @@ if __name__ == '__main__':
else:
mode_desc = "production"
# NOTE: it will say "Environment: production", but if DEBUG_MODE=True, then ignore that.
DebugUtils.print_warning(f"Running in {mode_desc} mode")
app.run(debug=DEBUG_MODE, host=host, port=port)
print(f"!!!WARNING!!! Running in {mode_desc} mode")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment