I am tying to use Flask-MongoEngine which is working fine, but I am trying to get the debug toolbar to work and when I follow the documentation I get a traceback shown below. I am able to run the normal flask debug toolbar fine but since I am using MongoDB as the database I am trying to use the flask debug toolbar with MongoDB. I know that the following line is the cause of this traceback `
app.config['DEBUG_TB_PANELS'] = ['flask_mongoengine.panels.MongoDebugPanel']
example code
from flask import Flask
from flask_debugtoolbar import DebugToolbarExtension
app = Flask(__name__)
app.config['DEBUG_TB_PANELS'] = ['flask_mongoengine.panels.MongoDebugPanel']
db = MongoEngine(app)
toolbar = DebugToolbarExtension(app)
line that causes traceback
app.config['DEBUG_TB_PANELS'] = ['flask_mongoengine.panels.MongoDebugPanel']
#traceback
Traceback (most recent call last):
File "app.py", line 27, in <module>
toolbar = DebugToolbarExtension(app)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_debugtoolbar/__init__.py", line 58, in __init__
self.init_app(app)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_debugtoolbar/__init__.py", line 72, in init_app
DebugToolbar.load_panels(app)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_debugtoolbar/toolbar.py", line 50, in load_panels
for panel_class in cls._iter_panels(app):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_debugtoolbar/toolbar.py", line 57, in _iter_panels
panel_class = cls._import_panel(app, panel_path)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_debugtoolbar/toolbar.py", line 71, in _import_panel
panel_class = import_string(path)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/werkzeug/utils.py", line 418, in import_string
__import__(import_name)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_mongoengine/panels.py", line 5, in <module>
from flask_mongoengine import operation_tracker
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_mongoengine/operation_tracker.py", line 26, in <module>
'_unpack_response': pymongo.helpers._unpack_response,
AttributeError: module 'pymongo.helpers' has no attribute '_unpack_response'