Search code examples
pythondjangosubdomainhostsdjango-settings

What does [::1] mean in ALLOWED_HOSTS in Django?


I was going through the documentation for Django's ALLOWED_HOSTS here

I came across a string ['localhost', '127.0.0.1', '[::1]'] in the ALLOWED_HOSTS.

Everything looks fine except the '[::1]' part.

I can't find a realtime scenario where '[::1]' is used.

Can someone please explain in which use case we will use this [::1]


Solution

  • [::1] is the loopback address in ipv6, the equivalent would be 127.0.0.1 in ipv4.