Files
Colormatic-Library-Sandbox/sandbox/settings.py
2025-05-20 21:27:20 -07:00

242 lines
6.4 KiB
Python

"""
Django settings for sandbox project.
Generated by 'djangocms' command using django CMS 5.0.0 and Django 5.2.1.
For more information on this file, see
https://docs.djangoproject.com/en/5.2/topics/settings/
For the full list of Django settings and their values, see
https://docs.djangoproject.com/en/5.2/ref/settings/
For the list of django CMS settings and their values, see
https://docs.django-cms.org/en/release-5.0.x/reference/configuration.html
"""
import os
from pathlib import Path
from django.utils.translation import gettext_lazy as _
# 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/5.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-l*51_imckgkjri#_$sjsq=mcm0329%)^&nfmq+wj30&e76#prk'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'djangocms_admin_style',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
# CMS base apps
'cms',
'menus',
'djangocms_text',
'djangocms_link',
'djangocms_alias',
'djangocms_versioning',
'sekizai',
'treebeard',
'parler',
'filer',
'easy_thumbnails',
'djangocms_frontend',
'djangocms_frontend.contrib.accordion',
'djangocms_frontend.contrib.alert',
'djangocms_frontend.contrib.badge',
'djangocms_frontend.contrib.card',
'djangocms_frontend.contrib.carousel',
'djangocms_frontend.contrib.collapse',
'djangocms_frontend.contrib.content',
'djangocms_frontend.contrib.grid',
'djangocms_frontend.contrib.icon',
'djangocms_frontend.contrib.image',
'djangocms_frontend.contrib.jumbotron',
'djangocms_frontend.contrib.link',
'djangocms_frontend.contrib.listgroup',
'djangocms_frontend.contrib.media',
'djangocms_frontend.contrib.navigation',
'djangocms_frontend.contrib.tabs',
'djangocms_frontend.contrib.utilities',
]
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',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'django.middleware.locale.LocaleMiddleware',
'cms.middleware.language.LanguageCookieMiddleware',
]
ROOT_URLCONF = 'sandbox.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(BASE_DIR, "sandbox", "templates"),
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.template.context_processors.i18n',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'sekizai.context_processors.sekizai',
'cms.context_processors.cms_settings',
],
},
},
]
THUMBNAIL_PROCESSORS = (
'easy_thumbnails.processors.colorspace',
'easy_thumbnails.processors.autocrop',
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
'easy_thumbnails.processors.filters',
)
WSGI_APPLICATION = 'sandbox.wsgi.application'
# Database
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/5.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/5.2/topics/i18n/
LANGUAGE_CODE = 'en'
LANGUAGES = [
("en", _("English")),
# Add additional languages here
]
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_THOUSAND_SEPARATOR = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.2/howto/static-files/
STATIC_URL = 'static/'
# Default primary key field type
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
# This is a django CMS 4 template
CMS_CONFIRM_VERSION4 = True
# django CMS requires the site framework
# https://docs.django-cms.org/en/release-5.0.x/how_to/multi-site.html
SITE_ID = 1
# A base template is part of this setup
# https://docs.django-cms.org/en/release-5.0.x/reference/configuration.html#cms-templates
CMS_TEMPLATES = (
("base.html", _("Standard")),
)
# Enable permissions
# https://docs.django-cms.org/en/release-5.0.x/topics/permissions.html
CMS_PERMISSION = True
# Allow admin sidebar to open admin URLs
X_FRAME_OPTIONS = 'SAMEORIGIN'
# Enable inline editing with djangocms-text
# https://github.com/django-cms/djangocms-text#inline-editing-feature
TEXT_INLINE_EDITING = True
# Allow deletion of version objects
# https://djangocms-versioning.readthedocs.io/en/latest/settings.html#DJANGOCMS_VERSIONING_ALLOW_DELETING_VERSIONS
DJANGOCMS_VERSIONING_ALLOW_DELETING_VERSIONS = True
# Add project-wide static files directory
# https://docs.djangoproject.com/en/5.2/ref/settings/#staticfiles-dirs
STATICFILES_DIRS = [
BASE_DIR / "sandbox" / "static",
]
INTERNAL_IPS = [
"127.0.0.1",
]
# Add project-wide static files directory
# https://docs.djangoproject.com/en/5.2/ref/settings/#media-root
MEDIA_URL = "media/"
MEDIA_ROOT = str(BASE_DIR.parent / "media")