|
5 | 5 |
|
6 | 6 | from datetime import timedelta |
7 | 7 |
|
8 | | -# 分页配置 |
9 | | -COUNT_DEFAULT = 10 |
10 | | -PAGE_DEFAULT = 0 |
11 | | - |
12 | | -# 令牌配置 |
13 | | -JWT_ACCESS_TOKEN_EXPIRES = timedelta(hours=1) |
14 | | - |
15 | | -# 屏蔽 sql alchemy 的 FSADeprecationWarning |
16 | | -SQLALCHEMY_TRACK_MODIFICATIONS = False |
17 | | - |
18 | | -# 插件模块暂时没有开启,以下配置可忽略 |
19 | | -# plugin config写在字典里面 |
20 | | -PLUGIN_PATH = { |
21 | | - 'poem': {'path': 'app.plugins.poem', 'enable': True, 'version': '0.0.1', 'limit': 20}, |
22 | | - 'oss': {'path': 'app.plugins.oss', 'enable': True, 'version': '0.0.1', 'access_key_id': 'not complete', 'access_key_secret': 'not complete', 'endpoint': 'http://oss-cn-shenzhen.aliyuncs.com', 'bucket_name': 'not complete', 'upload_folder': 'app', 'allowed_extensions': ['jpg', 'gif', 'png', 'bmp']} |
23 | | -} |
| 8 | + |
| 9 | +class BaseConfig(object): |
| 10 | + """ |
| 11 | + 基础配置 |
| 12 | + """ |
| 13 | + # 分页配置 |
| 14 | + COUNT_DEFAULT = 10 |
| 15 | + PAGE_DEFAULT = 0 |
| 16 | + |
| 17 | + # 屏蔽 sql alchemy 的 FSADeprecationWarning |
| 18 | + SQLALCHEMY_TRACK_MODIFICATIONS = False |
| 19 | + |
| 20 | + |
| 21 | +class DevelopmentConfig(BaseConfig): |
| 22 | + """ |
| 23 | + 开发环境普通配置 |
| 24 | + """ |
| 25 | + DEBUG = True |
| 26 | + |
| 27 | + # 令牌配置 |
| 28 | + JWT_ACCESS_TOKEN_EXPIRES = timedelta(hours=1) |
| 29 | + |
| 30 | + # 插件模块暂时没有开启,以下配置可忽略 |
| 31 | + # plugin config写在字典里面 |
| 32 | + PLUGIN_PATH = { |
| 33 | + 'poem': {'path': 'app.plugins.poem', 'enable': True, 'version': '0.0.1', 'limit': 20}, |
| 34 | + 'oss': {'path': 'app.plugins.oss', 'enable': True, 'version': '0.0.1', 'access_key_id': 'not complete', |
| 35 | + 'access_key_secret': 'not complete', 'endpoint': 'http://oss-cn-shenzhen.aliyuncs.com', |
| 36 | + 'bucket_name': 'not complete', 'upload_folder': 'app', |
| 37 | + 'allowed_extensions': ['jpg', 'gif', 'png', 'bmp']} |
| 38 | + } |
| 39 | + |
| 40 | + |
| 41 | +class ProductionConfig(BaseConfig): |
| 42 | + """ |
| 43 | + 生产环境普通配置 |
| 44 | + """ |
| 45 | + DEBUG = False |
| 46 | + |
| 47 | + # 令牌配置 |
| 48 | + JWT_ACCESS_TOKEN_EXPIRES = timedelta(hours=1) |
| 49 | + |
| 50 | + # 插件模块暂时没有开启,以下配置可忽略 |
| 51 | + # plugin config写在字典里面 |
| 52 | + PLUGIN_PATH = { |
| 53 | + 'poem': {'path': 'app.plugins.poem', 'enable': True, 'version': '0.0.1', 'limit': 20}, |
| 54 | + 'oss': {'path': 'app.plugins.oss', 'enable': True, 'version': '0.0.1', 'access_key_id': 'not complete', |
| 55 | + 'access_key_secret': 'not complete', 'endpoint': 'http://oss-cn-shenzhen.aliyuncs.com', |
| 56 | + 'bucket_name': 'not complete', 'upload_folder': 'app', |
| 57 | + 'allowed_extensions': ['jpg', 'gif', 'png', 'bmp']} |
| 58 | + } |
0 commit comments