6👍
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
27👍
If you have not installed the django-debug-toolbar
package you can install it with help of the below command:
pip install django-debug-toolbar
- [Django]-Suppress "?next=blah" behavior in django's login_required decorator
- [Django]-Using Cloudfront with Django S3Boto
- [Django]-Django Rest JWT login using username or email?
1👍
You can use the below command which worked perfectly for me:
$ python -m pip install -e git+https://github.com/jazzband/django-debug-toolbar.git#egg=django-debug-toolbar
- [Django]-Parsing unicode input using python json.loads
- [Django]-How to test "render to template" functions in django? (TDD)
- [Django]-Django 1.3.1 compilemessages. Error: sh: msgfmt: command not found
1👍
I did run across the same problem when trying to use debug toolbar with Django & docker.
The solution posted above did not solve the problem entirely. The toolbar was sometimes not visible on the rest_framework
browsable API.
I solved the problem by adding the below into my settings.py
INTERNAL_IPS = ['127.0.0.1',"0.0.0.0:8000"]
import socket
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]
ref:
https://knasmueller.net/fix-djangos-debug-toolbar-not-showing-inside-docker
- [Django]-Using django-admin on windows powershell
- [Django]-Django: For Loop to Iterate Form Fields
- [Django]-Getting Values of QuerySet in Django
0👍
I ran across this issue because we’re using docker containers for the development environment and we’re also using Pipenv to manage deps. Silly me, I did:
pipenv install django-debug-toolbar --dev
When in my environment this does no good because it will never be installed on my docker container environment. I had to reinstall without the --dev
part and it worked fine afterwards.
Hope this helps someone out in the same situation.
- [Django]-Add inline model to django admin site
- [Django]-Django Admin Form for Many to many relationship
- [Django]-Gunicorn Connection in Use: ('0.0.0.0', 5000)