60 lines
1.5 KiB
Python
Executable File
60 lines
1.5 KiB
Python
Executable File
"""Application configuration."""
|
|
|
|
import os
|
|
|
|
|
|
class Config:
|
|
"""Base configuration."""
|
|
|
|
SECRET_KEY = os.getenv("SECRET_KEY", "dev-secret-key")
|
|
|
|
# Database
|
|
SQLALCHEMY_DATABASE_URI = os.getenv(
|
|
"DATABASE_URL",
|
|
"postgresql://portal:portal@localhost:5433/customer_portal",
|
|
)
|
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
|
|
|
# Email
|
|
MAIL_SERVER = os.getenv("MAIL_SERVER", "localhost")
|
|
MAIL_PORT = int(os.getenv("MAIL_PORT", "587"))
|
|
MAIL_USE_TLS = os.getenv("MAIL_USE_TLS", "true").lower() == "true"
|
|
MAIL_USERNAME = os.getenv("MAIL_USERNAME")
|
|
MAIL_PASSWORD = os.getenv("MAIL_PASSWORD")
|
|
MAIL_DEFAULT_SENDER = os.getenv("MAIL_DEFAULT_SENDER")
|
|
|
|
# External APIs
|
|
WP_API_URL = os.getenv("WP_API_URL")
|
|
WP_API_SECRET = os.getenv("WP_API_SECRET")
|
|
VIDEO_API_URL = os.getenv("VIDEO_API_URL")
|
|
|
|
# Portal URL for emails
|
|
PORTAL_URL = os.getenv("PORTAL_URL", "http://localhost:8502")
|
|
|
|
# Session
|
|
SESSION_LIFETIME_HOURS = 24
|
|
OTP_LIFETIME_MINUTES = 10
|
|
OTP_MAX_ATTEMPTS = 5
|
|
|
|
# Form Pre-fill Token (for WordPress booking form)
|
|
PREFILL_TOKEN_EXPIRY = int(os.getenv("PREFILL_TOKEN_EXPIRY", "300")) # 5 minutes
|
|
|
|
|
|
class DevelopmentConfig(Config):
|
|
"""Development configuration."""
|
|
|
|
DEBUG = True
|
|
|
|
|
|
class ProductionConfig(Config):
|
|
"""Production configuration."""
|
|
|
|
DEBUG = False
|
|
|
|
|
|
config = {
|
|
"development": DevelopmentConfig,
|
|
"production": ProductionConfig,
|
|
"default": DevelopmentConfig,
|
|
}
|