-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
59 lines (43 loc) · 1.65 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
# -*- coding:utf-8 -*-
__author__ = u'kerry'
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = '\x03d\xf4\x95J\x15\xa4B\xfb\xc0\xaf \xd1A[j$}\x18\x16a\xe7\xd0\xec'
STRIPE_API_KEY = '\x03d\xf4\x95J\x15\xa4B\xfb\xc0\xaf \xd1A[j$}\x18\x16a\xe7\xd0\xec'
SSL_DISABLE = False
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_RECORD_QUERIES = True
FLASKY_SLOW_DB_QUERY_TIME = 0.5
WTF_CSRF_ENABLED = False
PAGE_SIZE = 15
SQLALCHEMY_ECHO = False
# SERVER_NAME = "dev.kerrygao.com"
# MAX_CONTENT_LENGTH = 160 * 1024 * 1024
# ALLOWED_EXTENSIONS = ['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']
VERSION = '1.0.1'
DEBUG = True
IS_LOCALHOST = True
#flask日志模块
LOG_FILE = 'flask_record.log'
LOG_LEVEL = 'd'
LOG_FILE_MAX_SIZE = 10 * 1024 * 1024
LOG_FILE_NUM_BACKUPS = 10
#所有SQLALCHEMY配置项可参考手册http://www.pythondoc.com/flask-sqlalchemy/config.html#id2
@staticmethod
def init_app(app):
pass
class LocalConfig(Config):
SQLALCHEMY_DATABASE_URI = "mysql://root:[email protected]/cqgcu?charset=utf8"
class DevelopmentConfig(Config):
SQLALCHEMY_DATABASE_URI = "mysql://xxxxx:xxxx@xxxxxxxxxxxxxxxxxx/cqgcu_enroll?charset=utf8"
LOG_FILE = '/var/log/cqgcu-enroll-manager/flask_record.log'
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = "mysql://root:[email protected]/cqgcu?charset=utf8"
LOG_FILE = '/var/log/cqgcu-enroll-manager/flask_record.log'
config = {
'development': DevelopmentConfig,
'production': ProductionConfig,
'local': LocalConfig,
}