import socket, platform hostname = socket.gethostname().replace('.','_').replace('-', '_') try: import os path = "settings_files/%s.py" % hostname path = os.path.join(os.path.dirname(__file__), path) execfile(path) except ImportError, e: import sys sys.stderr.write("Unable to read settings_files/%s.py\n" % hostname) sys.exit(1)