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.
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-14 12:46:27 +08:00
|
|
|
if you want to use mysql then replace "mysql|[Username]:[password]@[host]:[port]/[database]" with "sqlite"
|
2022-09-11 10:29:59 +08:00
|
|
|
example: mysql-root:114514@127.0.0.1:3306/homo
|
|
|
|
|
"""
|
|
|
|
|
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'
|