Use production config in production and dev config in dev.
This commit is contained in:
parent
25c4054c19
commit
67147240b6
4 changed files with 28 additions and 8 deletions
18
config.py
18
config.py
|
@ -1,5 +1,12 @@
|
|||
import logging
|
||||
|
||||
from peewee import MySQLDatabase, SqliteDatabase
|
||||
|
||||
|
||||
LOG_FORMAT = '%(asctime)-15s - %(levelname)s - %(pathname)s - ' + \
|
||||
'%(funcName)s - %(message)s'
|
||||
|
||||
|
||||
class FlaskConfig(object):
|
||||
SECRET_KEY = '1cb18882-6d12-440d-a4cc-b7430fb5f884'
|
||||
|
||||
|
@ -29,7 +36,7 @@ class RDSMySQL(object):
|
|||
'host': 'fluxmonkeylogin.cb0vumcygprn.us-east-1.rds.amazonaws.com',
|
||||
'user': 'fluxmonkey',
|
||||
'passwd': '8eifM#uoZ85xqC^',
|
||||
'threadlocals': True
|
||||
'threadlocals': True,
|
||||
}
|
||||
DB_DRIVER = MySQLDatabase
|
||||
|
||||
|
@ -48,7 +55,16 @@ class LocalStorage(object):
|
|||
|
||||
class DebugConfig(FlaskConfig, MailConfig, LocalStorage, SQLiteDB):
|
||||
REGISTRY_SERVER = 'localhost:5000'
|
||||
LOGGING_CONFIG = {
|
||||
'level': logging.DEBUG,
|
||||
'format': LOG_FORMAT
|
||||
}
|
||||
|
||||
|
||||
class ProductionConfig(FlaskConfig, MailConfig, S3Storage, RDSMySQL):
|
||||
REGISTRY_SERVER = 'quay.io'
|
||||
LOGGING_CONFIG = {
|
||||
'filename': '/opt/python/log/application.log',
|
||||
'level': logging.DEBUG,
|
||||
'format': LOG_FORMAT,
|
||||
}
|
||||
|
|
Reference in a new issue