xhs_crawler/config/db_config.py

22 lines
699 B
Python
Raw Normal View History

2023-07-30 12:43:02 +00:00
import os
2024-05-30 07:35:05 +00:00
import dotenv
dotenv.load_dotenv()
2023-07-30 12:43:02 +00:00
# redis config
2023-07-30 12:43:02 +00:00
REDIS_DB_HOST = "127.0.0.1" # your redis host
REDIS_DB_PWD = os.getenv("REDIS_DB_PWD", "123456") # your redis password
# mysql config
2024-05-30 07:35:05 +00:00
RELATION_DB_PWD = os.getenv("RELATION_DB_PWD", "123456")
RELATION_DB_USER = os.getenv("RELATION_DB_USER", "root")
RELATION_DB_HOST = os.getenv("RELATION_DB_HOST", "localhost")
RELATION_DB_PORT = os.getenv("RELATION_DB_PORT", "3306")
RELATION_DB_NAME = os.getenv("RELATION_DB_NAME", "media_crawler")
RELATION_DB_URL = f"mysql://{RELATION_DB_USER}:{RELATION_DB_PWD}@{RELATION_DB_HOST}:{RELATION_DB_PORT}/{RELATION_DB_NAME}"
2024-02-21 16:07:40 +00:00
# sqlite3 config
2024-05-30 07:35:05 +00:00
# RELATION_DB_URL = f"sqlite://data/media_crawler.sqlite"