reinheit/config/settings/base.py

136 lines
3.5 KiB
Python
Raw Normal View History

2024-06-24 21:16:48 +01:00
"""
Django settings for reinheit project.
Generated by 'django-admin startproject' using Django 5.0.6.
For more information on this file, see
https://docs.djangoproject.com/en/5.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.0/ref/settings/
"""
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
2024-06-24 22:13:32 +01:00
BASE_DIR = Path(__file__).resolve().parent.parent.parent
2024-06-24 21:16:48 +01:00
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
2024-06-24 21:25:07 +01:00
SECRET_KEY = "django-insecure-jqgf*tx%8h!t6o#)tl-7(hsc_gkjdosmko*u@)8+4r-frc27r1"
2024-06-24 21:16:48 +01:00
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
2024-06-24 21:25:07 +01:00
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
2024-06-25 20:59:37 +01:00
"django.contrib.humanize",
2024-06-24 22:02:22 +01:00
"django_bootstrap5",
2024-06-28 15:04:51 +01:00
"oauth2_authcodeflow",
2024-06-24 21:25:07 +01:00
"reinheit.apps.brew",
2024-06-24 21:45:20 +01:00
"reinheit.apps.styles",
"reinheit.apps.ingredients",
2024-06-24 21:16:48 +01:00
]
MIDDLEWARE = [
2024-06-24 21:25:07 +01:00
"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",
2024-06-24 21:16:48 +01:00
]
2024-06-24 21:25:07 +01:00
ROOT_URLCONF = "config.urls"
2024-06-24 21:16:48 +01:00
TEMPLATES = [
{
2024-06-24 21:25:07 +01:00
"BACKEND": "django.template.backends.django.DjangoTemplates",
2024-06-25 20:59:37 +01:00
"DIRS": [BASE_DIR / "reinheit" / "templates"],
2024-06-24 21:25:07 +01:00
"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",
2024-06-24 21:16:48 +01:00
],
},
},
]
2024-06-24 21:25:07 +01:00
WSGI_APPLICATION = "config.wsgi.application"
2024-06-24 21:16:48 +01:00
# Database
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
DATABASES = {
2024-06-24 21:25:07 +01:00
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
2024-06-24 21:16:48 +01:00
}
}
# Password validation
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
2024-06-24 21:25:07 +01:00
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
2024-06-24 21:16:48 +01:00
},
{
2024-06-24 21:25:07 +01:00
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
2024-06-24 21:16:48 +01:00
},
{
2024-06-24 21:25:07 +01:00
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
2024-06-24 21:16:48 +01:00
},
{
2024-06-24 21:25:07 +01:00
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
2024-06-24 21:16:48 +01:00
},
]
# Internationalization
# https://docs.djangoproject.com/en/5.0/topics/i18n/
2024-06-27 19:13:43 +01:00
LANGUAGE_CODE = "en-gb"
2024-06-24 21:16:48 +01:00
2024-06-24 21:25:07 +01:00
TIME_ZONE = "UTC"
2024-06-24 21:16:48 +01:00
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/
2024-06-24 21:25:07 +01:00
STATIC_URL = "static/"
2024-06-25 20:59:37 +01:00
STATICFILES_DIRS = [BASE_DIR / "reinheit" / "static"]
2024-06-24 21:16:48 +01:00
# Default primary key field type
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
2024-06-24 21:25:07 +01:00
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
2024-06-28 15:04:51 +01:00
AUTHENTICATION_BACKENDS = [
"oauth2_authcodeflow.auth.AuthenticationBackend",
"django.contrib.auth.backends.ModelBackend",
]