-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
49 lines (37 loc) · 1.23 KB
/
config.py
File metadata and controls
49 lines (37 loc) · 1.23 KB
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__title__ = ''
__author__ = 'changxin'
__mtime__ = '2018/5/15'
"""
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SQLALCHEMY_TRACK_MODIFICATIONS = True
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess key'
SQLALCHEMY_RECORD_QUERIES = True
FLASKY_DB_QUERY_TIMEOUT = 0.5
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = False
SQLALCHEMY_DATABASE_URI = os.environ.get(
'DEV_DATABASE_URL') or 'mysql+pymysql://root:Aizai2017.@127.0.0.1:3306/labeler?charset=utf8'
UPLOADPATH = os.getcwd() + '/upload'
class TestingConfig(Config):
TESTING = True
WTF_CSRF_ENABLED = False
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'test-data-dev.sqlite')
UPLOADPATH = os.getcwd() + '/upload'
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = os.environ.get(
'Product_DATABASE_URL') or 'mysql+pymysql://root:vrarPIC123@127.0.0.1:3306/labeler?charset=utf8'
UPLOADPATH = '/userdata/gongjujiao/'
config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
}