19 lines
659 B
Python
19 lines
659 B
Python
"""
|
|
Configuration for the Student Management System.
|
|
|
|
Connection settings are read from environment variables first, falling back
|
|
to the defaults below (which match the assignment's requirements). This
|
|
means you can run the app as-is, or override any value like:
|
|
|
|
DB_HOST=10.0.1.40 DB_USER=root DB_PASSWORD=secret python3 main.py
|
|
"""
|
|
|
|
import os
|
|
|
|
DB_HOST = os.environ.get("DB_HOST", "10.0.1.40")
|
|
DB_PORT = int(os.environ.get("DB_PORT", "3306"))
|
|
DB_USER = os.environ.get("DB_USER", "root")
|
|
DB_PASSWORD = os.environ.get("DB_PASSWORD", "")
|
|
DB_NAME = os.environ.get("DB_NAME", "student_db")
|
|
DB_CONNECT_TIMEOUT = int(os.environ.get("DB_CONNECT_TIMEOUT", "10"))
|