-
Notifications
You must be signed in to change notification settings - Fork 39
/
config.py
55 lines (41 loc) · 1.45 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
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
def __init__(self):
pass
SECRET_KEY = os.environ.get('SECRET_KEY') or '!@#$%^&*12345678'
SQLALCHEMY_RECORD_QUERIES = True
SQLALCHEMY_TRACK_MODIFICATIONS = True
# If use QQ email, please see http://service.mail.qq.com/cgi-bin/help?id=28 firstly.
MAIL_SERVER = 'smtp.qq.com'
MAIL_PORT = 465
MAIL_USE_SSL = True
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
FORUM_MAIL_SUBJECT_PREFIX = 'NaHan'
FORUM_MAIL_SENDER = 'Nahan <[email protected]>'
BABEL_DEFAULT_LOCALE = 'zh'
BABEL_DEFAULT_TIMEZONE = 'CST'
PER_PAGE = 10
UPLOAD_FOLDER = os.path.join(basedir, 'nahan/static/upload')
ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg'])
MAX_CONTENT_LENGTH = 512 * 1024
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
def __init__(self):
pass
DEBUG = True
SQLALCHEMY_DATABASE_URI = (os.environ.get('DEV_DATABASE_URL') or
'mysql://root:123456@localhost/nahan')
class ProductionConfig(Config):
def __init__(self):
pass
SQLALCHEMY_DATABASE_URI = (os.environ.get('DEV_DATABASE_URL') or
'mysql://root:123456@localhost/nahan')
config = {
'development': DevelopmentConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
}