-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfig.py
38 lines (30 loc) · 993 Bytes
/
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2016-08-04 23:46:16
# @Author : moling ([email protected])
# @Link : http://qiangtaoli.com
# @Version : $Id$
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_TRACK_MODIFICATIONS = True
JSON_AS_ASCII = False
JSONIFY_PRETTYPRINT_REGULAR = True
JSONIFY_MIMETYPE = 'application/json;charset=utf-8'
COOKIE_NAME = 'aweSession'
COOKIE_KEY = 'MbLog'
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'mysql+mysqlconnector://moling:www-data@localhost/mblog'
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///' + os.path.join(basedir, 'data.sqlite')
config = {
'development': DevelopmentConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
}