import os from dotenv import load_dotenv # Load environment variables from .env file load_dotenv() class Config: # Flask configuration SECRET_KEY = os.getenv('FLASK_SECRET_KEY', 'default-secret-key') # SQLite database configuration - 使用简单直接的路径 SQLALCHEMY_DATABASE_URI = 'sqlite:///blog.db' SQLALCHEMY_TRACK_MODIFICATIONS = False # Upload configuration UPLOAD_FOLDER = os.path.join('app', 'static', 'uploads') MAX_CONTENT_LENGTH = 16 * 1024 * 1024 # 16MB max file size # Admin authentication ADMIN_USERNAME = os.getenv('ADMIN_USERNAME', 'admin') ADMIN_PASSWORD = os.getenv('ADMIN_PASSWORD', 'password') # AI service configuration AI_API_KEY = os.getenv('AI_API_KEY') AI_BASE_URL = os.getenv('AI_BASE_URL', 'https://api.deepseek.com') # Allowed file extensions for uploads ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'}