Initial build
Some checks failed
Urania unit tests / Run-unit-tests (push) Failing after 1m29s

This commit is contained in:
2025-10-17 11:55:45 +02:00
parent 4b65f134fe
commit feb4663a3f
3 changed files with 60 additions and 13 deletions

View File

@@ -1,28 +1,27 @@
"""
Django settings for config project.
Django settings for PDA-New
Generated by 'django-admin startproject' using Django 5.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/5.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.2/ref/settings/
"""
import os
from pathlib import Path
from dotenv import load_dotenv
from environ import Env
BASE_DIR = Path(__file__).resolve().parent.parent
ENV_FILE = os.path.join(BASE_DIR,'.env')
load_dotenv(BASE_DIR / ".env")
env = Env()
env.read_env(ENV_FILE)
SECRET_KEY = env("DJANGO_SECRET_KEY", default='')
print('Starting without a secret key is not recommended in production') if not SECRET_KEY else None
SECRET_KEY = os.environ["DJANGO_SECRET_KEY"]
DEBUG = int(os.environ.get("DJANGO_DEBUG", default=0))
ALLOWED_HOSTS = os.environ.get(
"DJANGO_ALLOWED_HOSTS", default="localhost 127.0.0.1 0.0.0.0"
).split()
DEBUG = env.bool("DJANGO_DEBUG", default=False)
print('Debug mode ENABLED. Disable this before going into production') if DEBUG else None
ALLOWED_HOSTS = env.list("DJANGO_ALLOWED_HOSTS",
default="localhost,127.0.0.1,0.0.0.0")
INSTALLED_APPS = [
"django.contrib.admin",