Created
August 4, 2014 14:26
-
-
Save xuwenbao/a9d307b6dbbb85f078b8 to your computer and use it in GitHub Desktop.
Adds Confire support to Flask
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
def create_app(): | |
app = Flask(__name__) | |
app.from_object('conf.config') | |
return app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import confire | |
class AppConfiguration(confire.Configuration): | |
CONF_PATHS = [ | |
'/etc/project_name/project_name.yaml', | |
'~/.project_name.yaml', | |
'conf/project_name.yaml'] | |
config = AppConfiguration.load() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment