Skip to content

Commit c2f7829

Browse files
authored
Merge pull request hack4impact#157 from eoinieo/upstream/issue144
[bugfix] issue144. Debug/Testing mode printed when in Production mode.
2 parents fe0c567 + 164fbe5 commit c2f7829

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

config.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class Config:
6767
RQ_DEFAULT_PASSWORD = url.password
6868
RQ_DEFAULT_DB = 0
6969

70+
7071
@staticmethod
7172
def init_app(app):
7273
pass
@@ -77,7 +78,11 @@ class DevelopmentConfig(Config):
7778
ASSETS_DEBUG = True
7879
SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') or \
7980
'sqlite:///' + os.path.join(basedir, 'data-dev.sqlite')
80-
print('THIS APP IS IN DEBUG MODE. YOU SHOULD NOT SEE THIS IN PRODUCTION.')
81+
82+
83+
@classmethod
84+
def init_app(cls, app):
85+
print('THIS APP IS IN DEBUG MODE. YOU SHOULD NOT SEE THIS IN PRODUCTION.')
8186

8287

8388
class TestingConfig(Config):
@@ -87,6 +92,11 @@ class TestingConfig(Config):
8792
WTF_CSRF_ENABLED = False
8893

8994

95+
@classmethod
96+
def init_app(cls, app):
97+
print('THIS APP IS IN TESTING MODE. YOU SHOULD NOT SEE THIS IN PRODUCTION.')
98+
99+
90100
class ProductionConfig(Config):
91101
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
92102
'sqlite:///' + os.path.join(basedir, 'data.sqlite')

0 commit comments

Comments
 (0)