Adding Couchdb views from the blueprints are showing error... Tried with accessing the main app as 'current_app' but showing error 'RuntimeError: Working outside of application context.'
My Code from blueprint for adding/syncing couchdb views are as following:
from flask import current_app as app
manager = CouchDBManager()
with app.app_context():
manager.setup(app.app_context())
manager.add_viewdef(my_couchdb_view_from_blueprint)
manager.sync(app.app_context())
The error message is as following:
RuntimeError: Working outside of application context.
This typically means that you attempted to use functionality that needed
to interface with the current application object in a way. To solve
this set up an application context with app.app_context().
Adding Couchdb views from the blueprints are showing error... Tried with accessing the main app as 'current_app' but showing error 'RuntimeError: Working outside of application context.' My Code from blueprint for adding/syncing couchdb views are as following:
The error message is as following:
RuntimeError: Working outside of application context. This typically means that you attempted to use functionality that needed to interface with the current application object in a way. To solve this set up an application context with app.app_context().