ImportError: No module named 'debug_toolbar'

Hi there,
tutor k8s lms container gives same error. But tutor local working properly… Any ideas ?

(tutor) muro@mppc:~$ tutor k8s exec lms bash
kubectl exec -i -t --namespace openedx lms-5894c8bc5b-l9f9m -- sh -e -c bash
root@lms-5894c8bc5b-l9f9m:/openedx/edx-platform# ./ lms create_catalog_integrations --enabled \
>     --internal_api_url=http://discovery:8000/api/v1 \
>     --service_username=lms_catalog_service_user
Traceback (most recent call last):
  File "./", line 120, in <module>
  File "/openedx/edx-platform/lms/", line 20, in run
  File "/openedx/venv/lib/python3.5/site-packages/django/", line 24, in setup
  File "/openedx/venv/lib/python3.5/site-packages/django/apps/", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/openedx/venv/lib/python3.5/site-packages/django/apps/", line 90, in create
    module = import_module(entry)
  File "/opt/pyenv/versions/3.5.9/lib/python3.5/importlib/", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 985, in _gcd_import
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
ImportError: No module named 'debug_toolbar'

Anyone figured out how to fix this error? I’m using the latest tutor image overhangio/openedx:10.4.1 and I am getting same error.

When you exec into a container, you need to properly set the environment variables that are usually set by the entrypoint. You go through the entrypoint when you run a container, but not when you exec into it.

tl;dr: you should properly define the DJANGO_SETTINGS_MODULE environment variable.

Is there any document that outlines what are settings we need to before running

Also I see as entrypoint whereas in the container I don’t see that file at all.

Ok. I found how to set it


Thanks now it is working.

No there isn’t. If you exec into a running container we assume that you are a big boy and you know what you are doing :slight_smile:

1 Like