Skip to content

Instantly share code, notes, and snippets.

@brenj
Created November 28, 2015 06:48
Show Gist options
  • Save brenj/f8b124b121ce777a3681 to your computer and use it in GitHub Desktop.
Save brenj/f8b124b121ce777a3681 to your computer and use it in GitHub Desktop.
Store application configuration in a Flask blueprint.
@blueprint.record_once
def record_params(state):
"""Store app.config in blueprint when blueprint is registered on app."""
app = state.app
blueprint.config = {key: value for key, value in app.config.iteritems()}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment