commit
d15f78833f
|
@ -3,3 +3,4 @@ POSTGRES_PASSWORD=password
|
|||
DJANGO_SETTINGS_MODULE=network_inventory.settings.docker
|
||||
DJANGO_DEBUG=False
|
||||
DJANGO_SECRET_KEY=foo
|
||||
DOMAIN=inventory.example.com
|
||||
|
|
2
Makefile
2
Makefile
|
@ -6,7 +6,7 @@ SHELL=/usr/bin/env bash
|
|||
run: setup
|
||||
( \
|
||||
find . -name __pycache__ -o -name "*.pyc" -delete; \
|
||||
python manage.py runserver; \
|
||||
python manage.py runserver 0.0.0.0:8000; \
|
||||
)
|
||||
|
||||
.PHONY: setup
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
from socket import gethostname
|
||||
from socket import gethostbyname_ex
|
||||
|
||||
from .base import *
|
||||
|
||||
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "10.7.89.104"]
|
||||
|
||||
ALLOWED_HOSTS = [
|
||||
gethostname(),
|
||||
] + list(set(gethostbyname_ex(gethostname())[2]))
|
||||
|
||||
CSRF_TRUSTED_ORIGINS = [
|
||||
"http://localhost:8080",
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
from socket import gethostname
|
||||
from socket import gethostbyname
|
||||
from socket import getfqdn
|
||||
|
||||
from .base import *
|
||||
|
||||
|
||||
ALLOWED_HOSTS = [
|
||||
"localhost",
|
||||
"127.0.0.1",
|
||||
getfqdn(),
|
||||
gethostname(),
|
||||
gethostbyname(gethostname()),
|
||||
]
|
||||
|
||||
CSRF_TRUSTED_ORIGINS = [
|
||||
|
|
|
@ -1,7 +1,17 @@
|
|||
from socket import gethostname
|
||||
from socket import gethostbyname
|
||||
from socket import getfqdn
|
||||
|
||||
from .base import *
|
||||
|
||||
|
||||
ALLOWED_HOSTS = [
|
||||
"inventory.2li.local",
|
||||
"localhost",
|
||||
"127.0.0.1",
|
||||
getfqdn(),
|
||||
gethostname(),
|
||||
gethostbyname(gethostname()),
|
||||
os.getenv("DOMAIN"),
|
||||
]
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
|
|
Loading…
Reference in New Issue