Skip to content

Commit

Permalink
Add helper reference to the actual Flask stack
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jun 7, 2016
1 parent c2aa9c0 commit 26c1bd3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ckan/config/middleware/flask_app.py
Expand Up @@ -27,7 +27,6 @@
from ckan.plugins import PluginImplementations
from ckan.plugins.interfaces import IBlueprint

from ckan.config.middleware import common_middleware

import logging
log = logging.getLogger(__name__)
Expand All @@ -42,7 +41,7 @@ def make_flask_stack(conf, **app_conf):
debug = app_conf.get('debug', True)

root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
app = CKANFlask(__name__)
app = flask_app = CKANFlask(__name__)
app.debug = debug
app.template_folder = os.path.join(root, 'templates')
app.app_ctx_globals_class = CKAN_AppCtxGlobals
Expand Down Expand Up @@ -159,6 +158,9 @@ def hello_world_post():
who_parser.remote_user_key
)

# Add a reference to the actual Flask app so it's easier to access
setattr(app, '_flask_app', flask_app)

return app


Expand Down

0 comments on commit 26c1bd3

Please sign in to comment.