from socket import gethostname, gethostbyname, gethostbyname_ex ALLOWED_HOSTS = [ gethostname(), ] + list(set(gethostbyname_ex(gethostname())[2]))