File tree 3 files changed +20
-0
lines changed
3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -103,12 +103,26 @@ def init_app(cls, app):
103
103
app .logger .addHandler (file_handler )
104
104
105
105
106
+ class UnixConfig (ProductionConfig ):
107
+ @classmethod
108
+ def init_app (cls , app ):
109
+ ProductionConfig .init_app (app )
110
+
111
+ # log to syslog
112
+ import logging
113
+ from logging .handlers import SysLogHandler
114
+ syslog_handler = SysLogHandler ()
115
+ syslog_handler .setLevel (logging .INFO )
116
+ app .logger .addHandler (syslog_handler )
117
+
118
+
106
119
config = {
107
120
'development' : DevelopmentConfig ,
108
121
'testing' : TestingConfig ,
109
122
'production' : ProductionConfig ,
110
123
'heroku' : HerokuConfig ,
111
124
'docker' : DockerConfig ,
125
+ 'unix' : UnixConfig ,
112
126
113
127
'default' : DevelopmentConfig
114
128
}
Original file line number Diff line number Diff line change 1
1
import os
2
+ from dotenv import load_dotenv
3
+
4
+ dotenv_path = os .path .join (os .path .dirname (__file__ ), '.env' )
5
+ if os .path .exists (dotenv_path ):
6
+ load_dotenv (dotenv_path )
2
7
3
8
COV = None
4
9
if os .environ .get ('FLASK_COVERAGE' ):
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ Mako==1.0.7
20
20
Markdown==2.6.8
21
21
MarkupSafe==1.1.1
22
22
python-dateutil==2.6.1
23
+ python-dotenv==0.6.5
23
24
python-editor==1.0.3
24
25
six==1.10.0
25
26
SQLAlchemy==1.1.11
You can’t perform that action at this time.
0 commit comments