When I run the following code to determine my device's local IP address, I get 127.0.0.1 instead of 192.168.0.101.
import socket
import threading
PORT = 8080
HOST_NAME = socket.gethostname()
print(HOST_NAME)
SERVER = socket.gethostbyname(HOST_NAME)
print(SERVER)
The output i get on the console is
MyDeviceName.local
127.0.0.1