ImportError: cannot import name DebugToolbar
See original GitHub issueHi,
Just upgraded django-debug-toolbar to 1.0.1 (thanks for the extensive cleanup and improvements!) in my virtualenv from an older version, followed the new installation instructions but I get the following traceback:
Validating models...
Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x2f1aed0>>
Traceback (most recent call last):
File "/home/julen/envs/pootle-py2.7/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 91, in inner_run
self.validate(display_num_errors=True)
File "/home/julen/envs/pootle-py2.7/local/lib/python2.7/site-packages/django/core/management/base.py", line 266, in validate
num_errors = get_validation_errors(s, app)
File "/home/julen/envs/pootle-py2.7/local/lib/python2.7/site-packages/django/core/management/validation.py", line 30, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/home/julen/envs/pootle-py2.7/local/lib/python2.7/site-packages/django/db/models/loading.py", line 158, in get_app_errors
self._populate()
File "/home/julen/envs/pootle-py2.7/local/lib/python2.7/site-packages/django/db/models/loading.py", line 67, in _populate
self.load_app(app_name)
File "/home/julen/envs/pootle-py2.7/local/lib/python2.7/site-packages/django/db/models/loading.py", line 88, in load_app
models = import_module('.models', app_name)
File "/home/julen/envs/pootle-py2.7/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/julen/envs/pootle-py2.7/src/django-debug-toolbar/debug_toolbar/models.py", line 10, in <module>
from debug_toolbar.middleware import DebugToolbarMiddleware
File "/home/julen/envs/pootle-py2.7/src/django-debug-toolbar/debug_toolbar/middleware.py", line 13, in <module>
from debug_toolbar.toolbar import DebugToolbar
ImportError: cannot import name DebugToolbar
Tried both the quick and explicit setups with the same results.
I’m on Django 1.4.10, and if it’s of some help, I’m using the django-assets app for managing static files.
The issue looks similar to #500.
Issue Analytics
- State:
- Created 10 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
django ModuleNotFoundError: No module named 'debug ...
Typo error on my part. In settings.py under installed apps I had debug-toolbar instead of debug_toolbar .
Read more >flask.globals current_app Example Code - Full Stack Python
current_app is function in Flask's flask.globals module and is an instance of ... version("Flask-DebugToolbar") except ImportError: import pkg_resources ...
Read more >Django Debug Toolbar Loaded but not showing/appearing ...
The Debug Toolbar should have appeared only in Debug mode. So, the rest of the settings will be for DEBUG mode only. #...
Read more >Django Debug Toolbar - Read the Docs
The Debug Toolbar requires two things from core Django. ... types, Django relies on the mimetypes module from the Python standard library, ...
Read more >Flask-DebugToolbar - PyPI
Usage. Setting up the debug toolbar is simple: from flask import Flask from flask_debugtoolbar import DebugToolbarExtension app = Flask(__name__) # the toolbar ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@solova no special details needed, just
pip uninstall django-debug-toolbarandpip install django-debug-toolbar.You can try removing the .pyc files from your virtual environment
rm $(find . -type f -name "*.pyc"), but apart from that I have no secret sauce.