2024-01-06 12:13:39 +08:00
|
|
|
from datetime import timedelta
|
|
|
|
from pathlib import Path
|
2024-05-10 23:15:29 +08:00
|
|
|
from dotenv import load_dotenv, find_dotenv # Python dotenv
|
2024-01-06 12:13:39 +08:00
|
|
|
import os
|
|
|
|
|
|
|
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
2024-05-10 23:15:29 +08:00
|
|
|
# Backend folder (/backend)
|
2024-01-06 12:13:39 +08:00
|
|
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
2024-05-10 23:15:29 +08:00
|
|
|
# Root folder where docker-compose.yml is located
|
|
|
|
ROOT_DIR = Path(__file__).resolve().parent.parent.parent
|
|
|
|
|
2024-08-30 15:46:30 +08:00
|
|
|
# If you're hosting this with a secret provider, have this set to True
|
|
|
|
USE_VAULT = bool(os.getenv('USE_VAULT', False) == 'True')
|
|
|
|
# Have this set to True to serve media and static contents directly via Django
|
|
|
|
SERVE_MEDIA = bool(os.getenv('SERVE_MEDIA', False) == 'True')
|
2024-05-10 23:15:29 +08:00
|
|
|
|
|
|
|
load_dotenv(find_dotenv())
|
|
|
|
|
|
|
|
|
|
|
|
def get_secret(secret_name):
|
2024-08-30 15:46:30 +08:00
|
|
|
if USE_VAULT:
|
2024-05-10 23:15:29 +08:00
|
|
|
try:
|
|
|
|
pass
|
2024-08-30 15:46:30 +08:00
|
|
|
# Add specific implementations here if deploying to Azure, GCP, or AWS to get secrets from vault
|
2024-05-10 23:15:29 +08:00
|
|
|
except:
|
|
|
|
secret_value = ""
|
|
|
|
else:
|
|
|
|
# Fallback to .env or system environment variables for local development
|
|
|
|
secret_value = os.getenv(secret_name)
|
|
|
|
|
|
|
|
if secret_value is None:
|
|
|
|
raise ValueError(f"Secret '{secret_name}' not found.")
|
|
|
|
else:
|
|
|
|
return secret_value
|
|
|
|
|
|
|
|
|
|
|
|
# URL Prefixes
|
2024-08-30 19:28:24 +08:00
|
|
|
URL_SCHEME = 'https' if (get_secret('USE_HTTPS') == 'True') else 'http'
|
|
|
|
# Backend
|
|
|
|
BACKEND_ADDRESS = get_secret('BACKEND_ADDRESS')
|
|
|
|
BACKEND_PORT = get_secret('BACKEND_PORT')
|
|
|
|
# Frontend
|
|
|
|
FRONTEND_ADDRESS = get_secret('FRONTEND_ADDRESS')
|
|
|
|
FRONTEND_PORT = get_secret('FRONTEND_PORT')
|
2024-01-06 12:13:39 +08:00
|
|
|
|
2024-05-10 23:15:29 +08:00
|
|
|
ALLOWED_HOSTS = ['*']
|
|
|
|
CSRF_TRUSTED_ORIGINS = [
|
2024-08-30 19:28:24 +08:00
|
|
|
# Frontend
|
|
|
|
f'{URL_SCHEME}://{FRONTEND_ADDRESS}:{FRONTEND_PORT}',
|
2024-09-01 17:26:43 +08:00
|
|
|
f'{URL_SCHEME}://{FRONTEND_ADDRESS}', # For external domains
|
2024-08-30 19:28:24 +08:00
|
|
|
# Backend
|
|
|
|
f'{URL_SCHEME}://{BACKEND_ADDRESS}:{BACKEND_PORT}',
|
2024-09-01 17:26:43 +08:00
|
|
|
f'{URL_SCHEME}://{BACKEND_ADDRESS}' # For external domains
|
2024-08-30 15:46:30 +08:00
|
|
|
# You can also set up https://*.name.xyz for wildcards here
|
2024-05-10 23:15:29 +08:00
|
|
|
]
|
2024-01-06 12:13:39 +08:00
|
|
|
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
2024-05-10 23:15:29 +08:00
|
|
|
DEBUG = (get_secret('BACKEND_DEBUG') == 'True')
|
|
|
|
# Determines whether or not to insert test data within tables
|
|
|
|
SEED_DATA = (get_secret('SEED_DATA') == 'True')
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
|
|
|
SECRET_KEY = get_secret('SECRET_KEY')
|
|
|
|
# Selenium Config
|
|
|
|
# Initiate CAPTCHA solver in test mode
|
|
|
|
CAPTCHA_TESTING = (get_secret('CAPTCHA_TESTING') == 'True')
|
|
|
|
# If using Selenium and/or the provided CAPTCHA solver, determines whether or not to use proxies
|
|
|
|
USE_PROXY = (get_secret('USE_PROXY') == 'True')
|
|
|
|
|
|
|
|
# Stripe (For payments)
|
|
|
|
STRIPE_SECRET_KEY = get_secret(
|
|
|
|
"STRIPE_SECRET_KEY")
|
|
|
|
STRIPE_SECRET_WEBHOOK = get_secret('STRIPE_SECRET_WEBHOOK')
|
|
|
|
STRIPE_CHECKOUT_URL = f''
|
2024-01-06 12:13:39 +08:00
|
|
|
|
|
|
|
# Email credentials
|
2024-05-10 23:15:29 +08:00
|
|
|
EMAIL_HOST = get_secret('EMAIL_HOST')
|
|
|
|
EMAIL_HOST_USER = get_secret('EMAIL_HOST_USER')
|
|
|
|
EMAIL_HOST_PASSWORD = get_secret('EMAIL_HOST_PASSWORD')
|
|
|
|
EMAIL_PORT = get_secret('EMAIL_PORT')
|
2024-05-10 23:46:48 +08:00
|
|
|
EMAIL_USE_TLS = (get_secret('EMAIL_USE_TLS') == 'True')
|
2024-05-10 23:15:29 +08:00
|
|
|
EMAIL_ADDRESS = (get_secret('EMAIL_ADDRESS') == 'True')
|
2024-01-06 12:13:39 +08:00
|
|
|
|
|
|
|
# Application definition
|
|
|
|
|
|
|
|
INSTALLED_APPS = [
|
2024-05-10 23:15:29 +08:00
|
|
|
'config',
|
2024-01-06 12:13:39 +08:00
|
|
|
'unfold',
|
2024-05-10 23:15:29 +08:00
|
|
|
'unfold.contrib.filters',
|
2024-01-06 12:13:39 +08:00
|
|
|
'unfold.contrib.simple_history',
|
|
|
|
'django.contrib.admin',
|
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.messages',
|
|
|
|
'django.contrib.staticfiles',
|
2024-05-10 23:15:29 +08:00
|
|
|
'storages',
|
|
|
|
'django_extensions',
|
2024-01-06 12:13:39 +08:00
|
|
|
'rest_framework',
|
|
|
|
'rest_framework_simplejwt',
|
2024-05-10 23:15:29 +08:00
|
|
|
'django_celery_results',
|
|
|
|
'django_celery_beat',
|
2024-01-06 12:13:39 +08:00
|
|
|
'simple_history',
|
|
|
|
'djoser',
|
|
|
|
'corsheaders',
|
|
|
|
'drf_spectacular',
|
|
|
|
'drf_spectacular_sidecar',
|
2024-05-10 23:15:29 +08:00
|
|
|
'webdriver',
|
2024-01-06 12:13:39 +08:00
|
|
|
'accounts',
|
2024-05-10 23:15:29 +08:00
|
|
|
'user_groups',
|
|
|
|
'subscriptions',
|
|
|
|
'payments',
|
|
|
|
'billing',
|
|
|
|
'emails',
|
2024-09-24 16:08:28 +08:00
|
|
|
'notifications',
|
|
|
|
'search_results'
|
2024-01-06 12:13:39 +08:00
|
|
|
]
|
|
|
|
|
2024-09-06 19:58:17 +08:00
|
|
|
if DEBUG:
|
2024-09-07 00:08:28 +08:00
|
|
|
INSTALLED_APPS += ['silk']
|
2024-09-06 19:58:17 +08:00
|
|
|
MIDDLEWARE = [
|
|
|
|
'django.middleware.security.SecurityMiddleware',
|
|
|
|
"silk.middleware.SilkyMiddleware",
|
|
|
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
|
|
|
"corsheaders.middleware.CorsMiddleware",
|
|
|
|
'django.middleware.common.CommonMiddleware',
|
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
|
|
]
|
|
|
|
DJANGO_LOG_LEVEL = "DEBUG"
|
|
|
|
# Enables VS Code debugger to break on raised exceptions
|
|
|
|
DEBUG_PROPAGATE_EXCEPTIONS = "DEBUG"
|
|
|
|
LOGGING = {
|
|
|
|
"version": 1,
|
|
|
|
"disable_existing_loggers": False,
|
|
|
|
"handlers": {
|
|
|
|
"console": {
|
|
|
|
"class": "logging.StreamHandler",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"root": {
|
|
|
|
"handlers": ["console"],
|
|
|
|
"level": "DEBUG",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
else:
|
|
|
|
MIDDLEWARE = [
|
|
|
|
'django.middleware.security.SecurityMiddleware',
|
|
|
|
"whitenoise.middleware.WhiteNoiseMiddleware",
|
|
|
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
|
|
|
"corsheaders.middleware.CorsMiddleware",
|
|
|
|
'django.middleware.common.CommonMiddleware',
|
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
|
|
]
|
2024-01-06 12:13:39 +08:00
|
|
|
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
|
|
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
|
|
|
|
|
|
|
ROOT_URLCONF = 'config.urls'
|
2024-08-30 15:46:30 +08:00
|
|
|
if SERVE_MEDIA:
|
2024-05-10 23:15:29 +08:00
|
|
|
# Cloud Storage Settings
|
2024-08-30 15:46:30 +08:00
|
|
|
# This is assuming you use the same bucket for media and static containers
|
2024-05-10 23:15:29 +08:00
|
|
|
CLOUD_BUCKET = get_secret('CLOUD_BUCKET')
|
2024-08-30 15:46:30 +08:00
|
|
|
MEDIA_CONTAINER = get_secret('MEDIA_CONTAINER')
|
|
|
|
STATIC_CONTAINER = get_secret('STATIC_CONTAINER')
|
2024-05-10 23:15:29 +08:00
|
|
|
|
2024-08-30 15:46:30 +08:00
|
|
|
MEDIA_URL = f'https://{CLOUD_BUCKET}/{MEDIA_CONTAINER}/'
|
2024-05-10 23:15:29 +08:00
|
|
|
MEDIA_ROOT = f'https://{CLOUD_BUCKET}/'
|
|
|
|
|
2024-08-30 15:46:30 +08:00
|
|
|
STATIC_URL = f'https://{CLOUD_BUCKET}/{STATIC_CONTAINER}/'
|
|
|
|
STATIC_ROOT = f'https://{CLOUD_BUCKET}/{STATIC_CONTAINER}/'
|
2024-05-10 23:15:29 +08:00
|
|
|
|
|
|
|
# Consult django-storages documentation when filling in these values. This will vary depending on your cloud service provider
|
|
|
|
STORAGES = {
|
|
|
|
'default': {
|
|
|
|
# TODO: Set this up here if you're using cloud storage
|
|
|
|
'BACKEND': None,
|
|
|
|
'OPTIONS': {
|
|
|
|
# Optional parameters
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'staticfiles': {
|
|
|
|
# TODO: Set this up here if you're using cloud storage
|
|
|
|
'BACKEND': None,
|
|
|
|
'OPTIONS': {
|
|
|
|
# Optional parameters
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
else:
|
|
|
|
STATIC_URL = 'static/'
|
|
|
|
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
|
|
|
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
|
|
|
|
MEDIA_URL = 'api/v1/media/'
|
|
|
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
|
|
|
ROOT_URLCONF = 'config.urls'
|
2024-01-06 12:13:39 +08:00
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
2024-05-10 23:15:29 +08:00
|
|
|
'DIRS': [
|
2024-05-10 23:46:48 +08:00
|
|
|
BASE_DIR / 'emails/templates/',
|
2024-05-10 23:15:29 +08:00
|
|
|
],
|
2024-01-06 12:13:39 +08: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',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
REST_FRAMEWORK = {
|
|
|
|
'DEFAULT_AUTHENTICATION_CLASSES': (
|
|
|
|
'rest_framework_simplejwt.authentication.JWTAuthentication',
|
|
|
|
),
|
|
|
|
'DEFAULT_THROTTLE_CLASSES': [
|
|
|
|
|
|
|
|
'rest_framework.throttling.AnonRateThrottle',
|
|
|
|
|
|
|
|
'rest_framework.throttling.UserRateThrottle'
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
'DEFAULT_THROTTLE_RATES': {
|
|
|
|
|
|
|
|
'anon': '360/min',
|
|
|
|
|
|
|
|
'user': '1440/min'
|
|
|
|
|
|
|
|
},
|
|
|
|
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
|
|
|
|
}
|
|
|
|
|
|
|
|
# DRF-Spectacular
|
|
|
|
SPECTACULAR_SETTINGS = {
|
2024-05-10 23:15:29 +08:00
|
|
|
'TITLE': 'DRF-Template',
|
|
|
|
'DESCRIPTION': 'A Template Project by Keannu Bernasol',
|
2024-01-06 12:13:39 +08:00
|
|
|
'VERSION': '1.0.0',
|
|
|
|
'SERVE_INCLUDE_SCHEMA': False,
|
|
|
|
'SWAGGER_UI_DIST': 'SIDECAR',
|
|
|
|
'SWAGGER_UI_FAVICON_HREF': 'SIDECAR',
|
|
|
|
'REDOC_DIST': 'SIDECAR',
|
|
|
|
}
|
|
|
|
|
|
|
|
WSGI_APPLICATION = 'config.wsgi.application'
|
|
|
|
|
2024-09-05 13:16:23 +08:00
|
|
|
# If you're using an external connection bouncer (eg. PgBouncer), server side cursors must be disabled to avoid any issues
|
|
|
|
USE_BOUNCER = get_secret("USE_BOUNCER")
|
|
|
|
if USE_BOUNCER:
|
|
|
|
DISABLE_SERVER_SIDE_CURSORS = True
|
|
|
|
DB_HOST = get_secret("DB_BOUNCER_HOST")
|
|
|
|
DB_PORT = get_secret("DB_BOUNCER_PORT")
|
|
|
|
else:
|
|
|
|
DISABLE_SERVER_SIDE_CURSORS = False
|
|
|
|
DB_HOST = get_secret("DB_HOST")
|
|
|
|
DB_PORT = get_secret("DB_PORT")
|
|
|
|
|
2024-01-06 12:13:39 +08:00
|
|
|
DATABASES = {
|
2024-05-10 23:15:29 +08:00
|
|
|
"default": {
|
|
|
|
"ENGINE": "django.db.backends.postgresql",
|
2024-09-05 13:16:23 +08:00
|
|
|
'DISABLE_SERVER_SIDE_CURSORS': DISABLE_SERVER_SIDE_CURSORS,
|
2024-05-10 23:15:29 +08:00
|
|
|
"NAME": get_secret("DB_DATABASE"),
|
|
|
|
"USER": get_secret("DB_USERNAME"),
|
|
|
|
"PASSWORD": get_secret("DB_PASSWORD"),
|
2024-09-05 13:16:23 +08:00
|
|
|
"HOST": DB_HOST,
|
|
|
|
"PORT": DB_PORT,
|
2024-05-10 23:15:29 +08:00
|
|
|
"OPTIONS": {
|
|
|
|
"sslmode": get_secret("DB_SSL_MODE")
|
|
|
|
},
|
2024-01-06 12:13:39 +08:00
|
|
|
}
|
|
|
|
}
|
2024-08-30 15:46:30 +08:00
|
|
|
# Django Cache
|
|
|
|
CACHES = {
|
|
|
|
"default": {
|
|
|
|
"BACKEND": "django_redis.cache.RedisCache",
|
|
|
|
"LOCATION": f"redis://{get_secret('REDIS_HOST')}:{get_secret('REDIS_PORT')}/2",
|
|
|
|
"OPTIONS": {
|
|
|
|
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-01-06 12:13:39 +08:00
|
|
|
|
|
|
|
AUTH_USER_MODEL = 'accounts.CustomUser'
|
|
|
|
|
|
|
|
DJOSER = {
|
|
|
|
'SEND_ACTIVATION_EMAIL': True,
|
|
|
|
'SEND_CONFIRMATION_EMAIL': True,
|
|
|
|
'PASSWORD_RESET_CONFIRM_URL': 'reset_password_confirm/{uid}/{token}',
|
|
|
|
'ACTIVATION_URL': 'activation/{uid}/{token}',
|
|
|
|
'USER_AUTHENTICATION_RULES': ['djoser.authentication.TokenAuthenticationRule'],
|
2024-05-10 23:15:29 +08:00
|
|
|
'EMAIL': {
|
|
|
|
'activation': 'emails.templates.ActivationEmail',
|
|
|
|
'password_reset': 'emails.templates.PasswordResetEmail'
|
|
|
|
},
|
2024-01-06 12:13:39 +08:00
|
|
|
'SERIALIZERS': {
|
|
|
|
'user': 'accounts.serializers.CustomUserSerializer',
|
|
|
|
'current_user': 'accounts.serializers.CustomUserSerializer',
|
|
|
|
'user_create': 'accounts.serializers.UserRegistrationSerializer',
|
|
|
|
},
|
2024-05-10 23:15:29 +08:00
|
|
|
'PERMISSIONS': {
|
|
|
|
# Disable some unneeded endpoints by setting them to admin only
|
|
|
|
'username_reset': ['rest_framework.permissions.IsAdminUser'],
|
|
|
|
'username_reset_confirm': ['rest_framework.permissions.IsAdminUser'],
|
|
|
|
'set_username': ['rest_framework.permissions.IsAdminUser'],
|
|
|
|
'set_password': ['rest_framework.permissions.IsAdminUser'],
|
|
|
|
}
|
2024-01-06 12:13:39 +08: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',
|
2024-05-10 23:15:29 +08:00
|
|
|
"OPTIONS": {
|
|
|
|
"min_length": 8,
|
|
|
|
}
|
2024-01-06 12:13:39 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
|
|
|
},
|
2024-05-10 23:15:29 +08:00
|
|
|
# Additional password validators
|
|
|
|
{
|
|
|
|
'NAME': 'accounts.validators.SpecialCharacterValidator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'accounts.validators.LowercaseValidator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'accounts.validators.UppercaseValidator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'accounts.validators.NumberValidator',
|
|
|
|
},
|
2024-01-06 12:13:39 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
# Internationalization
|
|
|
|
# https://docs.djangoproject.com/en/4.2/topics/i18n/
|
|
|
|
|
|
|
|
LANGUAGE_CODE = 'en-us'
|
|
|
|
|
2024-08-30 15:46:30 +08:00
|
|
|
TIME_ZONE = get_secret('TIMEZONE')
|
2024-01-06 12:13:39 +08:00
|
|
|
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
USE_TZ = True
|
|
|
|
|
|
|
|
|
|
|
|
# Default primary key field type
|
|
|
|
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
|
|
|
|
|
|
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
|
|
|
|
2024-05-10 23:15:29 +08:00
|
|
|
SITE_NAME = 'DRF-Template'
|
2024-01-06 12:13:39 +08:00
|
|
|
|
2024-05-10 23:15:29 +08:00
|
|
|
# JWT Token Lifetimes
|
2024-01-06 12:13:39 +08:00
|
|
|
SIMPLE_JWT = {
|
2024-08-30 15:46:30 +08:00
|
|
|
"ACCESS_TOKEN_LIFETIME": timedelta(hours=1),
|
2024-05-10 23:15:29 +08:00
|
|
|
"REFRESH_TOKEN_LIFETIME": timedelta(days=3)
|
2024-01-06 12:13:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
CORS_ALLOW_ALL_ORIGINS = True
|
|
|
|
CORS_ALLOW_CREDENTIALS = True
|
2024-05-10 23:15:29 +08:00
|
|
|
|
|
|
|
# Celery Configuration Options
|
|
|
|
CELERY_TIMEZONE = TIME_ZONE
|
|
|
|
CELERY_TASK_TRACK_STARTED = True
|
|
|
|
CELERY_TASK_TIME_LIMIT = 30 * 60
|
|
|
|
CELERY_BROKER_URL = get_secret("CELERY_BROKER")
|
|
|
|
CELERY_BROKER = get_secret("CELERY_BROKER")
|
|
|
|
CELERY_BACKEND = get_secret("CELERY_BROKER")
|
|
|
|
CELERY_RESULT_BACKEND = get_secret("CELERY_RESULT_BACKEND")
|
|
|
|
CELERY_RESULT_EXTENDED = True
|
|
|
|
|
|
|
|
# Celery Beat Options
|
|
|
|
CELERY_BEAT_SCHEDULER = 'django_celery_beat.schedulers:DatabaseScheduler'
|
|
|
|
|
|
|
|
# Maximum number of rows that can be updated within the Django admin panel
|
|
|
|
DATA_UPLOAD_MAX_NUMBER_FIELDS = 20480
|
|
|
|
|
|
|
|
GRAPH_MODELS = {
|
2024-09-24 16:08:28 +08:00
|
|
|
'app_labels': ['accounts', 'user_groups', 'billing', 'emails', 'payments', 'subscriptions', 'search_results']
|
2024-05-10 23:15:29 +08:00
|
|
|
}
|