Created
September 3, 2019 12:45
-
-
Save bdunnette/d7c82eceb7eb06c2d2ce4c39b281014c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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