I am running a django server at localhost:8000 to accces it from iPhone i had connected the iphone and mac to the same network.
ifconfig |grep inet
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.94.0.1 netmask 0xff000000
inet 127.94.0.2 netmask 0xff000000
inet6 fe80::aede:48ff:fe00:1122%en5 prefixlen 64 scopeid 0x4
inet6 fe80::10a0:e008:9d34:5f7e%en0 prefixlen 64 secured scopeid 0x6
inet 192.168.43.234 netmask 0xffffff00 broadcast 192.168.43.255
inet6 2401:4900:2320:f3e9:10a0:ab34:c773:1104 prefixlen 64 autoconf secured
inet6 2401:4900:2320:f3e9:b444:77e0:94f:8ccc prefixlen 64 autoconf temporary
inet6 fe80::b4ed:bff:feba:10c2%awdl0 prefixlen 64 scopeid 0x8
inet6 fe80::b4ed:bff:feba:10c2%llw0 prefixlen 64 scopeid 0x9
inet6 fe80::54e:e417:7879:b351%utun0 prefixlen 64 scopeid 0xf
inet6 fe80::203b:4e44:1f36:a04c%utun1 prefixlen 64 scopeid 0x10
inet6 fe80::eaa6:a7d3:cf35:3fe1%utun2 prefixlen 64 scopeid 0x11
inet6 fe80::7604:df44:d8c4:65be%utun3 prefixlen 64 scopeid 0x12
inet6 fe80::3e0f:e8c3:e7a:f96c%utun4 prefixlen 64 scopeid 0x13
inet6 fe80::3719:2c00:294b:88be%utun5 prefixlen 64 scopeid 0x16
After running the ifconfig command i took out the ip adress of the mac i.e. 192.168.43.234. And using this address in safari i am not able to access the server from iphone.