Skip to content

Instantly share code, notes, and snippets.

@bdunnette
Created September 3, 2019 12:45
Show Gist options
  • Save bdunnette/d7c82eceb7eb06c2d2ce4c39b281014c to your computer and use it in GitHub Desktop.
Save bdunnette/d7c82eceb7eb06c2d2ce4c39b281014c to your computer and use it in GitHub Desktop.
import socket
import netifaces as ni
DEFAULT_INTERFACE = config('DEFAULT_INTERFACE', default='eth0')
DEFAULT_IP = ni.ifaddresses(DEFAULT_INTERFACE)[ni.AF_INET][0]['addr']
DEFAULT_HOSTNAME = socket.gethostname()
ALLOWED_HOSTS = ['localhost', '127.0.0.1', DEFAULT_IP, DEFAULT_HOSTNAME]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment