Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mellamocarloss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valencia Vargas, Carlos
mellamocarloss
Commits
b4a85368
Commit
b4a85368
authored
3 years ago
by
Michael Kyriakou
Browse files
Options
Downloads
Patches
Plain Diff
Refactored warning prints in app.py.
parent
81c4296c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app.py
+5
-3
5 additions, 3 deletions
app.py
with
5 additions
and
3 deletions
app.py
+
5
−
3
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,8 +83,8 @@ 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,
"
"
if you intended to run the CLI please run in development mode.
"
)
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
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment