-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
19 lines (14 loc) · 756 Bytes
/
run.py
File metadata and controls
19 lines (14 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from dotenv import load_dotenv
import os
# Load environment variables from .env file before anything else
load_dotenv()
from src.app import app
if __name__ == '__main__':
# The debug mode for the Flask server is now controlled by the FLASK_DEBUG
# environment variable loaded from the .env file via the Config object.
# The 'debug' parameter for app.run() can be set directly from the config.
is_debug_mode = app.config.get('FLASK_DEBUG', False)
# The reloader should be used in debug mode for a better development experience.
use_reloader = is_debug_mode
# Bind to 0.0.0.0 to make the application accessible from outside the container
app.run(host='0.0.0.0', port=5000, debug=is_debug_mode, use_reloader=use_reloader)