2022-01-25 03:15:53 +00:00
|
|
|
"""
|
|
|
|
Django settings for config project.
|
|
|
|
|
|
|
|
Generated by 'django-admin startproject' using Django 4.0.1.
|
|
|
|
|
|
|
|
For more information on this file, see
|
|
|
|
https://docs.djangoproject.com/en/4.0/topics/settings/
|
|
|
|
|
|
|
|
For the full list of settings and their values, see
|
|
|
|
https://docs.djangoproject.com/en/4.0/ref/settings/
|
|
|
|
"""
|
|
|
|
|
2024-11-05 09:13:26 +00:00
|
|
|
import os
|
2022-01-25 03:15:53 +00:00
|
|
|
from pathlib import Path
|
|
|
|
|
2024-11-05 09:13:26 +00:00
|
|
|
import sentry_sdk
|
|
|
|
from sentry_sdk.integrations.django import DjangoIntegration
|
|
|
|
|
2022-01-25 03:15:53 +00:00
|
|
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
|
|
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
|
|
|
|
|
|
|
|
|
|
# Quick-start development settings - unsuitable for production
|
|
|
|
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
|
|
|
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
2024-11-05 09:13:26 +00:00
|
|
|
SECRET_KEY = "django-insecure-$227hjjmuq2e!)o^@2v#+(-=@$v362o@8g#s9!2)tjn1)1a"
|
2022-01-25 03:15:53 +00:00
|
|
|
|
|
|
|
ALLOWED_HOSTS = []
|
|
|
|
|
2024-11-05 09:13:26 +00:00
|
|
|
DEFAULT_APPS = [
|
2023-11-25 17:47:46 +00:00
|
|
|
"django.contrib.admin",
|
|
|
|
"django.contrib.auth",
|
|
|
|
"django.contrib.contenttypes",
|
|
|
|
"django.contrib.sessions",
|
|
|
|
"django.contrib.messages",
|
|
|
|
"django.contrib.staticfiles",
|
2024-11-05 09:13:26 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
THIRD_PARTY_APPS = [
|
|
|
|
"rest_framework",
|
|
|
|
"corsheaders",
|
|
|
|
"storages",
|
|
|
|
"django_filters",
|
|
|
|
]
|
|
|
|
|
|
|
|
SELF_APPS = [
|
2024-02-02 01:57:30 +00:00
|
|
|
"apps.core",
|
2022-01-25 03:15:53 +00:00
|
|
|
]
|
|
|
|
|
2024-11-05 09:13:26 +00:00
|
|
|
INSTALLED_APPS = DEFAULT_APPS + THIRD_PARTY_APPS + SELF_APPS
|
|
|
|
|
2022-01-25 03:15:53 +00:00
|
|
|
MIDDLEWARE = [
|
2023-11-25 17:47:46 +00:00
|
|
|
"django.middleware.security.SecurityMiddleware",
|
|
|
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
2024-11-05 09:13:26 +00:00
|
|
|
"corsheaders.middleware.CorsMiddleware", # Third-Party Middleware
|
2023-11-25 17:47:46 +00:00
|
|
|
"django.middleware.common.CommonMiddleware",
|
|
|
|
"django.middleware.csrf.CsrfViewMiddleware",
|
|
|
|
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
|
|
|
"django.contrib.messages.middleware.MessageMiddleware",
|
|
|
|
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
2022-01-25 03:15:53 +00:00
|
|
|
]
|
|
|
|
|
2023-11-25 17:47:46 +00:00
|
|
|
ROOT_URLCONF = "config.urls"
|
2022-01-25 03:15:53 +00:00
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
2023-11-25 17:47:46 +00:00
|
|
|
"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",
|
2022-01-25 03:15:53 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2023-11-25 17:47:46 +00:00
|
|
|
WSGI_APPLICATION = "config.wsgi.application"
|
2022-01-25 03:15:53 +00:00
|
|
|
|
2024-02-02 02:10:10 +00:00
|
|
|
# Database
|
|
|
|
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
|
|
|
|
|
|
|
|
DATABASES = {
|
2024-11-05 09:13:26 +00:00
|
|
|
"default": {
|
|
|
|
"ENGINE": "django.db.backends.postgresql_psycopg2",
|
|
|
|
"NAME": "your-db-name",
|
|
|
|
"USER": "your-db-user",
|
|
|
|
"PASSWORD": "your-db-user-password",
|
|
|
|
"HOST": "your-db-host",
|
|
|
|
"PORT": "your-db-port",
|
2024-02-02 02:10:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-25 03:15:53 +00:00
|
|
|
|
|
|
|
# Password validation
|
|
|
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
|
|
|
|
|
|
|
|
AUTH_PASSWORD_VALIDATORS = [
|
|
|
|
{
|
2023-11-25 17:47:46 +00:00
|
|
|
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
2022-01-25 03:15:53 +00:00
|
|
|
},
|
|
|
|
{
|
2023-11-25 17:47:46 +00:00
|
|
|
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
2022-01-25 03:15:53 +00:00
|
|
|
},
|
|
|
|
{
|
2023-11-25 17:47:46 +00:00
|
|
|
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
|
2022-01-25 03:15:53 +00:00
|
|
|
},
|
|
|
|
{
|
2023-11-25 17:47:46 +00:00
|
|
|
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
|
2022-01-25 03:15:53 +00:00
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
# Internationalization
|
|
|
|
# https://docs.djangoproject.com/en/4.0/topics/i18n/
|
|
|
|
|
2023-11-25 17:47:46 +00:00
|
|
|
LANGUAGE_CODE = "en-us"
|
2022-01-25 03:15:53 +00:00
|
|
|
|
2023-11-25 17:47:46 +00:00
|
|
|
TIME_ZONE = "UTC"
|
2022-01-25 03:15:53 +00:00
|
|
|
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
USE_TZ = True
|
|
|
|
|
|
|
|
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
|
|
# https://docs.djangoproject.com/en/4.0/howto/static-files/
|
|
|
|
|
2023-11-25 17:47:46 +00:00
|
|
|
STATIC_URL = "static/"
|
2022-01-25 03:15:53 +00:00
|
|
|
|
|
|
|
# Default primary key field type
|
|
|
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
|
|
|
|
|
2023-11-25 17:47:46 +00:00
|
|
|
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
2022-08-15 04:38:11 +01:00
|
|
|
|
|
|
|
DEBUG = True
|
2024-11-05 09:13:26 +00:00
|
|
|
|
|
|
|
### --- SENTRY SETTINGS --- ###
|
|
|
|
if not DEBUG:
|
|
|
|
sentry_sdk.init(
|
|
|
|
dsn=os.environ("SENTRY_DSN"),
|
|
|
|
integrations=[
|
|
|
|
DjangoIntegration(),
|
|
|
|
],
|
|
|
|
traces_sample_rate=0.5,
|
|
|
|
send_default_pii=False,
|
|
|
|
)
|