Coverage for crunch/django/proj/settings.py: 100.00%
31 statements
« prev ^ index » next coverage.py v6.5.0, created at 2023-10-01 13:43 +0000
« prev ^ index » next coverage.py v6.5.0, created at 2023-10-01 13:43 +0000
1"""
2Django settings for django-crunch project.
4Generated by 'django-admin startproject' using Django 4.0.2.
6For more information on this file, see
7https://docs.djangoproject.com/en/4.0/topics/settings/
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/4.0/ref/settings/
11"""
12import os
13from pathlib import Path
15# Build paths inside the project like this: BASE_DIR / 'subdir'.
16BASE_DIR = Path.cwd()
18PROJ_DIR = Path(__file__).resolve().parent
20# Quick-start development settings - unsuitable for production
21# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
23# SECURITY WARNING: keep the secret key used in production secret!
24SECRET_KEY = 'django-insecure-ibbp#2t@pqvvt+!e-qn2&y*oq)@(^!rs4l424uf@0n970xic%d'
26# SECURITY WARNING: don't run with debug turned on in production!
27DEBUG = True
29ALLOWED_HOSTS = []
32# Application definition
34INSTALLED_APPS = [
35 'djangocms_admin_style',
36 'django.contrib.admin',
37 'django.contrib.auth',
38 'django.contrib.contenttypes',
39 'django.contrib.sessions',
40 'django.contrib.messages',
41 'django.contrib.staticfiles',
42 'polymorphic_tree',
43 'polymorphic',
44 "django_extensions",
45 'rest_framework',
46 "rest_framework.authtoken",
47 'django.contrib.sites',
48 'easy_thumbnails',
50 'filer',
51 'mptt',
53 'cms',
54 'sekizai',
55 'menus',
56 'treebeard',
57 'cms_bootstrap',
58 "djangocms_themata",
60 'djangocms_text_ckeditor',
61 'djangocms_icon',
62 'djangocms_link',
63 'djangocms_file',
64 'djangocms_picture',
65 'djangocms_video',
66 'djangocms_googlemap',
67 'djangocms_snippet',
68 'djangocms_style',
69 'meta',
70 'djangocms_page_meta',
72 'djangocms_bootstrap4',
73 'djangocms_bootstrap4.contrib.bootstrap4_alerts',
74 'djangocms_bootstrap4.contrib.bootstrap4_badge',
75 'djangocms_bootstrap4.contrib.bootstrap4_card',
76 'djangocms_bootstrap4.contrib.bootstrap4_carousel',
77 'djangocms_bootstrap4.contrib.bootstrap4_collapse',
78 'djangocms_bootstrap4.contrib.bootstrap4_content',
79 'djangocms_bootstrap4.contrib.bootstrap4_grid',
80 'djangocms_bootstrap4.contrib.bootstrap4_jumbotron',
81 'djangocms_bootstrap4.contrib.bootstrap4_link',
82 # 'djangocms_bootstrap4.contrib.bootstrap4_listgroup',
83 # 'djangocms_bootstrap4.contrib.bootstrap4_media',
84 # 'djangocms_bootstrap4.contrib.bootstrap4_picture',
85 'djangocms_bootstrap4.contrib.bootstrap4_tabs',
86 # 'djangocms_bootstrap4.contrib.bootstrap4_utilities',
88 'crunch',
89]
91MIDDLEWARE = [
92 'django.middleware.security.SecurityMiddleware',
93 'django.contrib.sessions.middleware.SessionMiddleware',
94 'django.middleware.common.CommonMiddleware',
95 'django.middleware.csrf.CsrfViewMiddleware',
96 'django.contrib.auth.middleware.AuthenticationMiddleware',
97 'django.contrib.messages.middleware.MessageMiddleware',
98 'django.middleware.clickjacking.XFrameOptionsMiddleware',
100 "django.middleware.locale.LocaleMiddleware",
102 'cms.middleware.user.CurrentUserMiddleware',
103 'cms.middleware.page.CurrentPageMiddleware',
104 'cms.middleware.toolbar.ToolbarMiddleware',
105 'cms.middleware.language.LanguageCookieMiddleware',
107]
109ROOT_URLCONF = 'crunch.django.proj.urls'
111TEMPLATES = [
112 {
113 'BACKEND': 'django.template.backends.django.DjangoTemplates',
114 'DIRS': [],
115 'APP_DIRS': True,
116 'OPTIONS': {
117 'context_processors': [
118 'django.template.context_processors.debug',
119 'django.template.context_processors.request',
120 'django.contrib.auth.context_processors.auth',
121 'django.contrib.messages.context_processors.messages',
122 'cms.context_processors.cms_settings',
123 'sekizai.context_processors.sekizai',
124 ],
125 },
126 },
127]
129WSGI_APPLICATION = 'crunch.django.proj.wsgi.application'
132# Database
133# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
135DATABASES = {
136 'default': {
137 'ENGINE': 'django.db.backends.sqlite3',
138 'NAME': BASE_DIR / 'db.sqlite3',
139 }
140}
143# Password validation
144# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
146AUTH_PASSWORD_VALIDATORS = [
147 {
148 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
149 },
150 {
151 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
152 },
153 {
154 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
155 },
156 {
157 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
158 },
159]
162# Internationalization
163# https://docs.djangoproject.com/en/4.0/topics/i18n/
165LANGUAGE_CODE = 'en'
166LANGUAGES = [
167 ('en', 'English'),
168]
171TIME_ZONE = 'UTC'
173USE_I18N = True
175USE_TZ = True
178# Static files (CSS, JavaScript, Images)
179# https://docs.djangoproject.com/en/4.0/howto/static-files/
181STATIC_URL = 'static/'
182STATIC_ROOT = str(PROJ_DIR / "staticfiles")
184# Default primary key field type
185# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
187DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
189REST_FRAMEWORK = {
190 "DEFAULT_AUTHENTICATION_CLASSES": (
191 'rest_framework.authentication.BasicAuthentication',
192 "rest_framework.authentication.SessionAuthentication",
193 "rest_framework.authentication.TokenAuthentication",
194 ),
195 "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.DjangoModelPermissions",),
196 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
197 'PAGE_SIZE': 20,
198}
200SITE_ID = 1
201X_FRAME_OPTIONS = 'SAMEORIGIN'
203CMSPLUGIN_CASCADE_PLUGINS = []
204CMS_TOOLBAR_ANONYMOUS_ON = False
206CMS_PERMISSION = True
207CMS_TEMPLATES = [
208 ('base.html', 'Base Template'),
209]
211MEDIA_ROOT = os.path.join(BASE_DIR, 'storage/')
212MEDIA_URL = '/storage/'