File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -99,12 +99,26 @@ def init_app(cls, app):
9999 app .logger .addHandler (file_handler )
100100
101101
102+ class UnixConfig (ProductionConfig ):
103+ @classmethod
104+ def init_app (cls , app ):
105+ ProductionConfig .init_app (app )
106+
107+ # log to syslog
108+ import logging
109+ from logging .handlers import SysLogHandler
110+ syslog_handler = SysLogHandler ()
111+ syslog_handler .setLevel (logging .INFO )
112+ app .logger .addHandler (syslog_handler )
113+
114+
102115config = {
103116 'development' : DevelopmentConfig ,
104117 'testing' : TestingConfig ,
105118 'production' : ProductionConfig ,
106119 'heroku' : HerokuConfig ,
107120 'docker' : DockerConfig ,
121+ 'unix' : UnixConfig ,
108122
109123 'default' : DevelopmentConfig
110124}
Original file line number Diff line number Diff line change 11import 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 )
27
38COV = None
49if os .environ .get ('FLASK_COVERAGE' ):
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ Mako==1.0.7
2020Markdown==2.6.8
2121MarkupSafe==1.0
2222python-dateutil==2.6.1
23+ python-dotenv==0.6.5
2324python-editor==1.0.3
2425six==1.10.0
2526SQLAlchemy==1.1.11
You can’t perform that action at this time.
0 commit comments