quote-rss-plugin/config.py.back
2025-08-13 22:48:17 +08:00

41 lines
No EOL
1 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import os
from datetime import timedelta
class Config:
"""应用配置类"""
# Flask配置
SECRET_KEY = os.environ.get('SECRET_KEY', 'dev-secret-key-change-in-production')
# OKX配置公共接口不需要API密钥
OKX_API_KEY = os.environ.get('OKX_API_KEY', '')
OKX_SECRET_KEY = os.environ.get('OKX_SECRET_KEY', '')
OKX_PASSPHRASE = os.environ.get('OKX_PASSPHRASE', '')
# RSS配置
RSS_TITLE = "Crypto RSS Service"
RSS_DESCRIPTION = "Real-time cryptocurrency prices and more"
RSS_LANGUAGE = "zh-cn"
RSS_LINK = "http://localhost:5000"
# 缓存配置
CACHE_TIMEOUT = timedelta(seconds=30) # 30秒缓存适合低频率刷新
# 服务配置
DEFAULT_CRYPTO_PAIR = "ETH-USDT"
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
class ProductionConfig(Config):
DEBUG = False
config = {
'development': DevelopmentConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
}