When I try running the project, Django can not load the django-debug-toolbar plugin for some reason. Error message says:
web_1 | ModuleNotFoundError: No module named 'debug_toolbar'
Here is my settings.py
INSTALLED_APPS = [
# ...
'django.contrib.staticfiles',
# ...
'debug_toolbar',
]
MIDDLEWARE = [
# ...
'debug_toolbar.middleware.DebugToolbarMiddleware',
# ...
]
INTERNAL_IPS = ('127.0.0.1', '192.168.0.1',)
if you are not installed the django-debug-toolbar please install with help of below command
pip install django-debug-toolbar
i had to re-install django-debug-toolbar by adding it to requirements.txt and then running:
docker-compose build web
After doing that, the toolbar wasn't still showing. I had to add this code to the settings.py file
def show_toolbar(request):
return True
DEBUG_TOOLBAR_CONFIG = {
"SHOW_TOOLBAR_CALLBACK" : show_toolbar,
}
Answered here: https://stackoverflow.com/a/10518040/11011598
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With