Add local IP to debug conf

This commit is contained in:
Gabriel Augendre 2022-10-31 00:48:02 +01:00
parent d80172e96a
commit 093e0f2501

View file

@ -3,10 +3,6 @@ from pathlib import Path
import environ import environ
INTERNAL_IPS = [
"127.0.0.1",
]
PROJECT_ROOT = Path(__file__).resolve().parent.parent.parent PROJECT_ROOT = Path(__file__).resolve().parent.parent.parent
BASE_DIR = PROJECT_ROOT / "src" BASE_DIR = PROJECT_ROOT / "src"
CONTRIB_DIR = PROJECT_ROOT / "contrib" CONTRIB_DIR = PROJECT_ROOT / "contrib"
@ -35,8 +31,20 @@ SECRET_KEY = env("SECRET_KEY")
DEBUG = env("DEBUG") DEBUG = env("DEBUG")
DEBUG_TOOLBAR = env("DEBUG") and env("DEBUG_TOOLBAR") DEBUG_TOOLBAR = env("DEBUG") and env("DEBUG_TOOLBAR")
INTERNAL_IPS = [
"127.0.0.1",
]
ALLOWED_HOSTS = env("ALLOWED_HOSTS") ALLOWED_HOSTS = env("ALLOWED_HOSTS")
if DEBUG:
import socket
hostname = socket.gethostname()
ip = socket.gethostbyname(hostname)
INTERNAL_IPS.append(ip)
ALLOWED_HOSTS.append(ip)
# Application definition # Application definition
DJANGO_APPS = [ DJANGO_APPS = [