FlaskSocketIO – RuntimeError: Working outside of application context. To solve this, set up an application context with app.app_context()

Solution
        with app.app_context():
            emit('notification_response', resp, namespace='/', broadcast=True)