attribute 字段名规范
This commit is contained in:
0
app/core/__init__.py
Normal file
0
app/core/__init__.py
Normal file
49
app/core/config.py
Normal file
49
app/core/config.py
Normal file
@@ -0,0 +1,49 @@
|
||||
import logging
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
from pydantic import BaseSettings
|
||||
|
||||
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../'))
|
||||
logging.info(f"BASE_DIR : {BASE_DIR}")
|
||||
load_dotenv(os.path.join(BASE_DIR, '.env'))
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
PROJECT_NAME = os.getenv('PROJECT_NAME', 'FASTAPI BASE')
|
||||
SECRET_KEY = os.getenv('SECRET_KEY', '')
|
||||
API_PREFIX = ''
|
||||
BACKEND_CORS_ORIGINS = ['*']
|
||||
DATABASE_URL = os.getenv('SQL_DATABASE_URL', '')
|
||||
ACCESS_TOKEN_EXPIRE_SECONDS: int = 60 * 60 * 24 * 7 # Token expired after 7 days
|
||||
SECURITY_ALGORITHM = 'HS256'
|
||||
LOGGING_CONFIG_FILE = os.path.join(BASE_DIR, 'logging_env.py')
|
||||
|
||||
|
||||
settings = Settings()
|
||||
|
||||
MINIO_IP = "18.167.251.121"
|
||||
MINIO_PORT = 8000
|
||||
MINIO_SECURE = False
|
||||
MINIO_ACCESS = "e8zc55mzDOh4IzRrZ9Oa"
|
||||
MINIO_SECRET = "uHfqJ7UkwA1PTDGfnA44Hp9ux5YkZTkzZLjeOYhE"
|
||||
|
||||
OM_TRITON_IP = "10.1.1.240"
|
||||
OM_TRITON_PORT = "10010"
|
||||
|
||||
ATT_TRITON_IP = "10.1.1.240"
|
||||
ATT_TRITON_PORT = "10020"
|
||||
|
||||
# service env
|
||||
# LOGS_PATH = "app/logs/errors.log"
|
||||
# FASHION_CATEGORIES = "app/service/outfit_matcher/config/fashion_categories.json"
|
||||
# FASHION_CATEGORIES_MAPPING = "app/service/outfit_matcher/config/fashion_category_mapping.json"
|
||||
|
||||
# pycharm debug
|
||||
LOGS_PATH = "logs/errors.log"
|
||||
FASHION_CATEGORIES = "service/outfit_matcher/config/fashion_categories.json"
|
||||
FASHION_CATEGORIES_MAPPING = "service/outfit_matcher/config/fashion_category_mapping.json"
|
||||
|
||||
|
||||
# LOGS_PATH = "app/logs/errors.log"
|
||||
# FASHION_CATEGORIES = "./config/fashion_categories.json"
|
||||
# FASHION_CATEGORIES_MAPPING = "./config/fashion_category_mapping.json"
|
||||
Reference in New Issue
Block a user