-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
58 lines (46 loc) · 1.61 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
55
56
57
58
import os
basedir = os.path.abspath(os.path.dirname(__file__))
DB_TYPE_POSTGRES = 'postgres'
DB_TYPE_MYSQL = 'mysql'
class Config:
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
@staticmethod
def init_app(app):
pass
class DevConfig(Config):
DEBUG = True
SECRET_KEY = '1918'
# SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'db_dev.sqlite')
SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:[email protected]:5432/crmit'
DB_TYPE = DB_TYPE_POSTGRES
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 465
MAIL_USE_SSL = True
MAIL_USERNAME = 'natalykanatkina'
MAIL_PASSWORD = os.getenv('MAIL_PASSWORD')
MAIL_DEFAULT_SENDER = '[email protected]'
VK_ACCESS_TOKEN = os.getenv('VK_ACCESS_TOKEN')
ACCESS_TOKEN_SALT = '1918'.encode('utf-8')
DEVELOPER_READ_ONLY = True
JSON_AS_ASCII = False
class ProdConfig(Config):
SECRET_KEY = '<param_secret_key>'
SQLALCHEMY_DATABASE_URI = 'mysql+mysqlconnector://kristallp_crm:<param_db_password>@kristallp.mysql/kristallp_crm'
DB_TYPE = DB_TYPE_MYSQL
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 465
MAIL_USE_SSL = True
MAIL_USERNAME = 'natalykanatkina'
MAIL_PASSWORD = '<pws>' # todo
MAIL_DEFAULT_SENDER = '[email protected]'
VK_ACCESS_TOKEN = '<token>' # todo
ACCESS_TOKEN_SALT = '<param_access_token_salt>'.encode('utf-8')
DEVELOPER_READ_ONLY = True
JSON_AS_ASCII = False
config = {
'dev': DevConfig,
'prod': ProdConfig,
# 'default' will be rewritten to ProdConfig while deploy.
'default': DevConfig
}