topwebmaster
@topwebmaster
Веб-программист, django, laravel, php, python

Баг в debug_toolbar «cannot import name 'sql'.»?

код:
/Users/user/envs/fp/bin/python /Volumes/xdata/www/py/fortunepeople/manage.py runserver 8000
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x107d3aea0>
Traceback (most recent call last):
  File "/Users/user/envs/fp/lib/python3.5/site-packages/debug_toolbar/toolbar.py", line 118, in get_panel_classes
    mod = import_module(panel_module)
  File "/Users/user/envs/fp/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/Users/user/envs/fp/lib/python3.5/site-packages/debug_toolbar/panels/sql/__init__.py", line 1, in <module>
    from debug_toolbar.panels.sql.panel import SQLPanel  # noqa
  File "/Users/user/envs/fp/lib/python3.5/site-packages/debug_toolbar/panels/sql/panel.py", line 12, in <module>
    from debug_toolbar.panels.sql import views
  File "/Users/user/envs/fp/lib/python3.5/site-packages/debug_toolbar/panels/sql/views.py", line 7, in <module>
    from debug_toolbar.panels.sql.forms import SQLSelectForm
  File "/Users/user/envs/fp/lib/python3.5/site-packages/debug_toolbar/panels/sql/forms.py", line 13, in <module>
    from debug_toolbar.panels.sql.utils import reformat_sql
  File "/Users/user/envs/fp/lib/python3.5/site-packages/debug_toolbar/panels/sql/utils.py", line 5, in <module>
    import sqlparse
  File "/Users/user/envs/fp/lib/python3.5/site-packages/sqlparse/__init__.py", line 11, in <module>
    from sqlparse import sql
ImportError: cannot import name 'sql'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/envs/fp/lib/python3.5/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/Users/user/envs/fp/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 113, in inner_run
    autoreload.raise_last_exception()
  File "/Users/user/envs/fp/lib/python3.5/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
    six.reraise(*_exception)
  File "/Users/user/envs/fp/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/Users/user/envs/fp/lib/python3.5/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/Users/user/envs/fp/lib/python3.5/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/user/envs/fp/lib/python3.5/site-packages/django/apps/registry.py", line 115, in populate
    app_config.ready()
  File "/Users/user/envs/fp/lib/python3.5/site-packages/debug_toolbar/apps.py", line 16, in ready
    dt_settings.check_middleware()
  File "/Users/user/envs/fp/lib/python3.5/site-packages/debug_toolbar/settings.py", line 173, in check_middleware
    from debug_toolbar.middleware import DebugToolbarMiddleware
  File "/Users/user/envs/fp/lib/python3.5/site-packages/debug_toolbar/middleware.py", line 16, in <module>
    from debug_toolbar.toolbar import DebugToolbar
  File "/Users/user/envs/fp/lib/python3.5/site-packages/debug_toolbar/toolbar.py", line 151, in <module>
    urlpatterns = DebugToolbar.get_urls()
  File "/Users/user/envs/fp/lib/python3.5/site-packages/debug_toolbar/toolbar.py", line 145, in get_urls
    for panel_class in cls.get_panel_classes():
  File "/Users/user/envs/fp/lib/python3.5/site-packages/debug_toolbar/toolbar.py", line 122, in get_panel_classes
    (panel_module, e))
django.core.exceptions.ImproperlyConfigured: Error importing debug panel debug_toolbar.panels.sql: "cannot import name 'sql'"


  • Вопрос задан
  • 185 просмотров
Пригласить эксперта
Ответы на вопрос 1
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы