惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
Last Week in AI
Last Week in AI
T
Tailwind CSS Blog
WordPress大学
WordPress大学
B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
C
Check Point Blog
P
Proofpoint News Feed
H
Help Net Security
月光博客
月光博客
博客园_首页
Stack Overflow Blog
Stack Overflow Blog
博客园 - 三生石上(FineUI控件)
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
人人都是产品经理
人人都是产品经理
U
Unit 42
美团技术团队
I
InfoQ
A
About on SuperTechFans

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Django Debug Toolbar + Docker: The Missing INTERNAL_IPS P...
Merdas369 · 2026-06-13 · via DEV Community

Merdas369

Django Debug Toolbar Didn't Appear When Running Django in Docker

I'm currently working on an online accessories shop as a personal project. I usually use Django Debug Toolbar in all of my Django projects, so setting it up is almost automatic for me.

This time, however, my project was running inside Docker.

After preparing everything and starting the containers, I opened the browser and noticed that the Django Debug Toolbar panel wasn't showing up.

My first thought was that I had missed a setup step, so I went back to the Django Debug Toolbar documentation and checked everything again. I followed the installation guide step by step and verified all the settings. Everything looked correct, but the toolbar still didn't appear.

After searching online for a while, I found the real cause.

Django Debug Toolbar only appears when the request comes from an IP address listed in "INTERNAL_IPS". Normally, when running Django locally, "127.0.0.1" or "localhost" is enough.

With Docker, things are a little different. The request doesn't always come from the usual local address, so Debug Toolbar may think the request is coming from an external IP and refuse to display itself.

To discover the actual IP address reaching Django, I created a simple view:

from django.http import HttpResponse

def test(request):
    return HttpResponse(request.META.get("REMOTE_ADDR"))

When I visited that endpoint, the response was:

172.18.0.1

After adding that IP address to "INTERNAL_IPS":

INTERNAL_IPS = [
    "127.0.0.1",
    "172.18.0.1",
]

the Django Debug Toolbar appeared perfectly in the browser.

What I Learned

This issue reminded me of an important debugging lesson:

When something that normally works suddenly stops working after introducing a new tool or layer (such as Docker), don't assume the original tool is broken. Sometimes the new component changes the environment in a way that affects the existing behavior.

In my case, Django Debug Toolbar was working exactly as designed. Docker simply changed where the request was coming from.