This commit is contained in:
edschuy95 2025-07-13 23:38:59 -04:00
parent eeda32a9b2
commit e865fcdd36
3 changed files with 35 additions and 0 deletions

13
app.py
View file

@ -1,8 +1,21 @@
from flask import Flask
from routes import yeastar, voipms
import logging
import os
import shutil
import sys
# Check for config.py at runtime
if not os.path.exists("config.py"):
print("config.py not found — creating from config.template.py")
try:
shutil.copyfile("config.template.py", "config.py")
print("Created config.py — please edit it with your real secrets.")
sys.exit(1) # Exit so user must edit it manually
except Exception as e:
print(f"Failed to create config.py: {e}")
sys.exit(1)
# Disable Flask/Werkzeug noisy request log
log = logging.getLogger('werkzeug')
log.setLevel(logging.ERROR)