feat: add sensible defaults
This commit is contained in:
parent
5eca3ec130
commit
9982b25444
|
@ -1,4 +1,5 @@
|
||||||
# Current Project Ignores
|
# Current Project Ignores
|
||||||
|
.ruff_cache/
|
||||||
|
|
||||||
# OS ignores
|
# OS ignores
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
|
|
|
@ -10,8 +10,12 @@ For the full list of settings and their values, see
|
||||||
https://docs.djangoproject.com/en/4.0/ref/settings/
|
https://docs.djangoproject.com/en/4.0/ref/settings/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
import sentry_sdk
|
||||||
|
from sentry_sdk.integrations.django import DjangoIntegration
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
|
@ -20,28 +24,36 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
SECRET_KEY = (
|
SECRET_KEY = "django-insecure-$227hjjmuq2e!)o^@2v#+(-=@$v362o@8g#s9!2)tjn1)1a"
|
||||||
"django-insecure-$227hjjmuq2e!)o^@2v#+(-=@$v362o@8g#s9!2)tjn1)1a"
|
|
||||||
)
|
|
||||||
|
|
||||||
ALLOWED_HOSTS = []
|
ALLOWED_HOSTS = []
|
||||||
|
|
||||||
|
DEFAULT_APPS = [
|
||||||
# Application definition
|
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
|
||||||
"django.contrib.admin",
|
"django.contrib.admin",
|
||||||
"django.contrib.auth",
|
"django.contrib.auth",
|
||||||
"django.contrib.contenttypes",
|
"django.contrib.contenttypes",
|
||||||
"django.contrib.sessions",
|
"django.contrib.sessions",
|
||||||
"django.contrib.messages",
|
"django.contrib.messages",
|
||||||
"django.contrib.staticfiles",
|
"django.contrib.staticfiles",
|
||||||
|
]
|
||||||
|
|
||||||
|
THIRD_PARTY_APPS = [
|
||||||
|
"rest_framework",
|
||||||
|
"corsheaders",
|
||||||
|
"storages",
|
||||||
|
"django_filters",
|
||||||
|
]
|
||||||
|
|
||||||
|
SELF_APPS = [
|
||||||
"apps.core",
|
"apps.core",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
INSTALLED_APPS = DEFAULT_APPS + THIRD_PARTY_APPS + SELF_APPS
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
"django.middleware.security.SecurityMiddleware",
|
"django.middleware.security.SecurityMiddleware",
|
||||||
"django.contrib.sessions.middleware.SessionMiddleware",
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||||
|
"corsheaders.middleware.CorsMiddleware", # Third-Party Middleware
|
||||||
"django.middleware.common.CommonMiddleware",
|
"django.middleware.common.CommonMiddleware",
|
||||||
"django.middleware.csrf.CsrfViewMiddleware",
|
"django.middleware.csrf.CsrfViewMiddleware",
|
||||||
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
||||||
|
@ -73,13 +85,13 @@ WSGI_APPLICATION = "config.wsgi.application"
|
||||||
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
|
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
"default": {
|
||||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
"ENGINE": "django.db.backends.postgresql_psycopg2",
|
||||||
'NAME': 'your-db-name',
|
"NAME": "your-db-name",
|
||||||
'USER': 'your-db-user',
|
"USER": "your-db-user",
|
||||||
'PASSWORD': 'your-db-user-password',
|
"PASSWORD": "your-db-user-password",
|
||||||
'HOST': 'your-db-host',
|
"HOST": "your-db-host",
|
||||||
'PORT': 'your-db-port',
|
"PORT": "your-db-port",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,3 +138,14 @@ STATIC_URL = "static/"
|
||||||
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
||||||
|
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
|
|
||||||
|
### --- SENTRY SETTINGS --- ###
|
||||||
|
if not DEBUG:
|
||||||
|
sentry_sdk.init(
|
||||||
|
dsn=os.environ("SENTRY_DSN"),
|
||||||
|
integrations=[
|
||||||
|
DjangoIntegration(),
|
||||||
|
],
|
||||||
|
traces_sample_rate=0.5,
|
||||||
|
send_default_pii=False,
|
||||||
|
)
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
[pytest]
|
||||||
|
DJANGO_SETTINGS_MODULE = config.settings
|
||||||
|
python_files = tests.py test_*.py *_tests.py
|
|
@ -0,0 +1,9 @@
|
||||||
|
Django
|
||||||
|
djangorestframework
|
||||||
|
django-cors-headers
|
||||||
|
django-filter
|
||||||
|
django-storages
|
||||||
|
psycopg2-binary==2.9.9
|
||||||
|
Pillow
|
||||||
|
sentry-sdk
|
||||||
|
gunicorn
|
Loading…
Reference in New Issue