Files
Document_Translator/check_config.py
beabigegg b11a8272c4 2ND
2025-09-02 13:11:48 +08:00

33 lines
839 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
檢查配置
"""
import sys
import os
# 添加 app 路徑
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
def main():
from app import create_app
app = create_app()
with app.app_context():
print("配置檢查:")
print(f"DIFY_API_BASE_URL: '{app.config.get('DIFY_API_BASE_URL', 'NOT_SET')}'")
print(f"DIFY_API_KEY: '{app.config.get('DIFY_API_KEY', 'NOT_SET')}'")
# 檢查 api.txt 文件
import os
if os.path.exists('api.txt'):
with open('api.txt', 'r', encoding='utf-8') as f:
content = f.read()
print(f"\napi.txt 內容:")
print(content)
else:
print("\napi.txt 文件不存在")
if __name__ == "__main__":
main()