-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.py
More file actions
31 lines (26 loc) · 1.24 KB
/
Copy pathconfig.py
File metadata and controls
31 lines (26 loc) · 1.24 KB
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
# ============================================================
# config.py — Flask Configuration
# ============================================================
import os
from datetime import timedelta
class Config:
# ── Security
SECRET_KEY = os.environ.get('SECRET_KEY', 'cer_super_secret_key_change_in_production')
JWT_SECRET_KEY = os.environ.get('JWT_SECRET_KEY', 'cer_jwt_secret_change_in_production')
JWT_ACCESS_TOKEN_EXPIRES = timedelta(hours=8)
JWT_REFRESH_TOKEN_EXPIRES = timedelta(days=30)
# ── Database
# Defaulting to SQLite for easy portability.
# In Render.com, you can set DATABASE_URL to 'sqlite:////data/app.db' for persistence.
_db_url = os.environ.get('DATABASE_URL', 'sqlite:///app.db')
if _db_url.startswith("postgres://"):
_db_url = _db_url.replace("postgres://", "postgresql://", 1)
SQLALCHEMY_DATABASE_URI = _db_url
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False
# ── NVIDIA NIM API Key
# Set NVIDIA_API_KEY as an environment variable (Render dashboard, or local .env)
NVIDIA_API_KEY = os.environ.get('NVIDIA_API_KEY')
# ── App
DEBUG = os.environ.get('FLASK_DEBUG', 'true').lower() == 'true'
QUESTIONS_PER_ROOM = 4