Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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]

like image 660
Underoos Avatar asked Dec 17 '22 16:12

Underoos


2 Answers

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

like image 113
M. Chris Avatar answered Dec 20 '22 05:12

M. Chris


I know ::1 is normally used for IPv6 as localhost

like image 27
Roknix Avatar answered Dec 20 '22 07:12

Roknix