Merge pull request #67 from Nebucatnetzer/dev

Dev
This commit is contained in:
Andreas Zweili 2022-03-27 16:18:21 +02:00 committed by GitHub
commit d15f78833f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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",

View File

@ -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 = [

View File

@ -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!