This repository has been archived on 2026-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
RepApp/rc_hip/rc_hip/settings.py

141 lines
3.7 KiB
Python
Raw Normal View History

2023-04-16 11:01:31 +00:00
"""
Django settings for rc_hip project.
Generated by 'django-admin startproject' using Django 4.2.
For more information on this file, see
https://docs.djangoproject.com/en/4.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.2/ref/settings/
"""
2023-04-17 18:57:55 +00:00
import mimetypes
import os
2023-04-16 11:01:31 +00:00
from pathlib import Path
2023-04-17 18:57:55 +00:00
mimetypes.add_type("text/css", ".css", True)
2023-04-16 11:01:31 +00:00
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
2023-04-17 18:57:55 +00:00
STATIC_ROOT = os.path.join(BASE_DIR, "static")
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
2023-04-16 11:01:31 +00:00
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
2023-04-17 18:57:55 +00:00
# SECRET_KEY = 'django-insecure-ura&_-(r(&&b$0s!a=07c@k6c!8=8m7$5(4#w8m@79-e%rn6s*'
SECRET_KEY = os.environ.get(
"DJANGO_SECRET_KEY", 'django-insecure-ura&_-(r(&&b$0s!a=07c@k6c!8=8m7$5(4#w8m@79-e%rn6s*')
2023-04-16 11:01:31 +00:00
# SECURITY WARNING: don't run with debug turned on in production!
2023-04-17 18:57:55 +00:00
DEBUG = os.getenv("DJANGO_DEBUG", 'true').lower() in ('true', '1', 't')
2023-04-16 11:01:31 +00:00
2023-04-17 19:48:32 +00:00
ALLOWED_HOSTS = [
'127.0.0.1',
'localhost',
'repapp.rc-hip.de'
]
2023-04-16 11:01:31 +00:00
# Application definition
INSTALLED_APPS = [
2023-04-16 17:55:54 +00:00
'repapp.apps.RepappConfig',
2023-04-16 11:01:31 +00:00
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'rc_hip.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'rc_hip.wsgi.application'
# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
2023-04-17 18:57:55 +00:00
'NAME': BASE_DIR / 'data' / 'db.sqlite3',
2023-04-16 11:01:31 +00:00
}
}
# Password validation
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/4.2/topics/i18n/
LANGUAGE_CODE = 'de'
2023-04-16 11:01:31 +00:00
2023-04-16 17:55:54 +00:00
TIME_ZONE = 'Europe/Berlin'
2023-04-16 11:01:31 +00:00
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.2/howto/static-files/
STATIC_URL = 'static/'
# Default primary key field type
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
2023-04-17 18:57:55 +00:00
CSRF_TRUSTED_ORIGINS = [
'https://repapp.rc-hip.de',
'http://127.0.0.1:8020'
]