-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
31 lines (24 loc) · 731 Bytes
/
app.py
File metadata and controls
31 lines (24 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from flask import Flask
from db import init_db
from routes import configure_routes
# Set environment: Change this value to 'production' or 'development'
ENV = 'production' # Change to 'production' when deploying
app = Flask(__name__)
# Configuration based on environment
if ENV == 'production':
app.config['SECRET_KEY'] = 'your_production_secret_key'
DEBUG_MODE = False
HOST = '0.0.0.0'
PORT = 8080
else:
app.config['SECRET_KEY'] = 'your_dev_secret_key'
DEBUG_MODE = True
HOST = '127.0.0.1'
PORT = 8083
# Initialize the database
with app.app_context():
init_db()
# Configure routes
configure_routes(app)
if __name__ == '__main__':
app.run(debug=DEBUG_MODE, host=HOST, port=PORT)