diff --git a/ynr/settings/local.py.container.example b/ynr/settings/local.py.container.example new file mode 100644 index 000000000..48179889f --- /dev/null +++ b/ynr/settings/local.py.container.example @@ -0,0 +1,26 @@ +# Only set DEBUG to True in development environments. +DEBUG = True + +# This short, known value is insecure. +SECRET_KEY = "development" + +# Certain errors are very noisy (obscuring the real problem) if this list is +# empty. +ADMINS = [("Dummy Admin", "dummy@example.com")] + +# This permits the site to be served at localhost:8080. +ALLOWED_HOSTS = ['*'] + +# This unpleasantness adds the container's internal IP to the list of those IPs +# permitted to access the Django debug toolbar, which allows it to be enabled. +# We believe the container's own IP needs to be in this list because of +# something to do with the container networking, or the HTTP server gunicorn's +# reverse-proxy setup, or both. +# TODO: Replace with a better method, either here or by changing the +# container/gunicorn setup. https://pypi.org/project/netifaces/ also exists, +# but might not be considered "better". +import socket +s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) +s.connect(("8.8.8.8", 80)) +INTERNAL_IPS = [ '127.0.0.1', str(s.getsockname()[0]) ] +s.close()