-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
config.py
54 lines (47 loc) · 2.08 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
################################ CONFIG #######################################
class Config(object):
PACKAGE_NAME = 'proxybet'
PACKAGE_VERSION = '0.0.1'
DATABASE_USERNAME = 'postgres'
DATABASE_PASSWORD = 'XXXXXXXX'
# DOMAIN_NAME = 'dznet.host'
LOG_FORMAT = '%(asctime)s - %(lineno)d - %(name)s: %(levelname)s %(message)s'
LOG_PATH = 'log/{}.log'.format(__name__)
SERVER_HOST = '0.0.0.0'
SERVER_PORT = 5505
# SERVER_NAME = '{}:{}'.format(DOMAIN_NAME, SERVER_PORT)
SESSION_COOKIE_DOMAIN = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False
def database_uri(DATABASE_NAME):
return 'postgresql://{}:{}@{}/{}'.format(Config.DATABASE_USERNAME,
Config.DATABASE_PASSWORD,
Config.SERVER_HOST,
DATABASE_NAME)
class Development(Config):
DATABASE_NAME = '{}_dev'.format(Config.PACKAGE_NAME)
DEBUG = True
SECRET_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
SQLALCHEMY_DATABASE_URI = Config.database_uri(DATABASE_NAME)
TELEGRAM_API_ID = 'XXXXX'
TELEGRAM_API_HASH = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
TELEGRAM_BOT_TOKEN = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
TESTING = False
class Testing(Config):
DATABASE_NAME = '{}_test'.format(Config.PACKAGE_NAME)
DEBUG = True
SECRET_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
SQLALCHEMY_DATABASE_URI = Config.database_uri(DATABASE_NAME)
TELEGRAM_API_ID = 'XXXXX'
TELEGRAM_API_HASH = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
TELEGRAM_BOT_TOKEN = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
TESTING = True
class Production(Config):
DATABASE_NAME = '{}_prod'.format(Config.PACKAGE_NAME)
DEBUG = False
SECRET_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
SQLALCHEMY_DATABASE_URI = Config.database_uri(DATABASE_NAME)
TELEGRAM_API_ID = 'XXXXX'
TELEGRAM_API_HASH = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
TELEGRAM_BOT_TOKEN = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
TESTING = False