Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PaaS-templates
python-flask-template
Commits
b4a85368
Commit
b4a85368
authored
Nov 09, 2021
by
Michael Kyriakou
Browse files
Refactored warning prints in app.py.
parent
81c4296c
Pipeline
#209758
failed with stages
in 3 minutes and 20 seconds
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
app.py
View file @
b4a85368
...
...
@@ -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,7 +83,7 @@ if not MIGRATION_MODE:
handle_cli
(
app
,
lookup_db_for_binding
,
cli_args
)
exit
(
1
)
else
:
print
(
"!!!WARNING!!! A
pplication should not be run with CLI arguments, "
DebugUtils
.
print_warning
(
"Production a
pplication 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"
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment