django-debug-toolbar not showing up

前端 未结 27 1671
谎友^
谎友^ 2020-11-30 20:12

I looked at other questions and can\'t figure it out...

I did the following to install django-debug-toolbar:

  1. pip install django-debug-toolbar
27条回答
  •  被撕碎了的回忆
    2020-11-30 21:04

    I know this question is a bit old, but today i installed django-toolbar with docker and came across with the same issue, this solved it for me

    INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"]
    
    import socket
    hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
    INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]
    

    As i read in a comment, the issue is that docker uses a dynamic ip, to solve this we can get the ip from the code above

提交回复
热议问题