Use production config in production and dev config in dev.

This commit is contained in:
yackob03 2013-09-30 23:54:12 -04:00
parent 25c4054c19
commit 67147240b6
4 changed files with 28 additions and 8 deletions

View file

@ -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,
}