This repository has been archived on 2026-08-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
MoeCounter/src/config.py
T

26 lines
887 B
Python
Raw Normal View History

2022-09-11 10:29:59 +08:00
#!/usr/bin/env python3
# -- coding:utf-8 --
# @Author: markushammered@gmail.com
# @Development Tool: PyCharm
# @Create Time: 2022/9/11
# @File Name: config.py
import os
class Config:
"""
database type. Default is sqlite
2022-09-14 12:46:27 +08:00
database file path is "./src/db/data.sqlite", it is not exists, before you run server first
2022-09-11 10:29:59 +08:00
remote sqlite file url is "https://pac.rtst.tech/static_file_hosting/static/counter/data.sqlite"
you can download it manually
2022-09-18 09:18:43 +08:00
if you want to use mysql then replace "mysql://[Username]:[password]@[host]:[port]/[database]" with "sqlite"
example: mysql://root:114514@127.0.0.1:3306/homo
2022-09-11 10:29:59 +08:00
"""
2022-09-18 09:18:43 +08:00
database = "mysql://counter:114514@111.173.80.154:26098/Counter"
# database = 'sqlite'
2022-09-14 12:46:27 +08:00
if 'sqlite' in database:
os.environ['counter_db_type'] = 'sqlite'
elif 'mysql' in database:
os.environ['counter_db_type'] = 'mysql'