2022-04-03 01:20:53 +02:00
|
|
|
"""
|
2022-04-06 00:54:14 +02:00
|
|
|
Django settings for open_democracy_back project.
|
2022-04-03 01:20:53 +02:00
|
|
|
|
2022-04-06 00:54:14 +02:00
|
|
|
Generated by 'django-admin startproject' using Django 3.2.11.
|
2022-04-03 01:20:53 +02:00
|
|
|
|
|
|
|
For more information on this file, see
|
|
|
|
https://docs.djangoproject.com/en/3.2/topics/settings/
|
|
|
|
|
|
|
|
For the full list of settings and their values, see
|
|
|
|
https://docs.djangoproject.com/en/3.2/ref/settings/
|
|
|
|
"""
|
2022-04-06 00:54:14 +02:00
|
|
|
import getconf
|
2022-04-03 01:20:53 +02:00
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
|
|
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
|
|
|
2022-04-06 00:54:14 +02:00
|
|
|
config = getconf.ConfigGetter(
|
|
|
|
"cineClub",
|
|
|
|
["./local_settings.ini"],
|
|
|
|
)
|
|
|
|
|
2022-04-03 01:20:53 +02:00
|
|
|
|
|
|
|
# Quick-start development settings - unsuitable for production
|
|
|
|
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
|
|
|
|
|
|
|
|
|
|
|
|
# Application definition
|
|
|
|
|
|
|
|
INSTALLED_APPS = [
|
2022-04-03 01:20:54 +02:00
|
|
|
"django.contrib.admin",
|
|
|
|
"django.contrib.auth",
|
|
|
|
"django.contrib.contenttypes",
|
|
|
|
"django.contrib.sessions",
|
|
|
|
"django.contrib.messages",
|
|
|
|
"django.contrib.staticfiles",
|
|
|
|
"myapi.apps.MyapiConfig",
|
|
|
|
"rest_framework",
|
2022-04-06 00:54:14 +02:00
|
|
|
"corsheaders",
|
2022-04-03 01:20:53 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
MIDDLEWARE = [
|
2022-04-03 01:20:54 +02:00
|
|
|
"django.middleware.security.SecurityMiddleware",
|
|
|
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
|
|
|
"django.middleware.common.CommonMiddleware",
|
2022-04-06 00:54:14 +02:00
|
|
|
"corsheaders.middleware.CorsMiddleware",
|
2022-04-03 01:20:54 +02:00
|
|
|
"django.middleware.csrf.CsrfViewMiddleware",
|
|
|
|
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
|
|
|
"django.contrib.messages.middleware.MessageMiddleware",
|
|
|
|
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
2022-04-03 01:20:53 +02:00
|
|
|
]
|
|
|
|
|
2022-04-03 01:20:54 +02:00
|
|
|
ROOT_URLCONF = "ulm_cine_club_api.urls"
|
2022-04-03 01:20:53 +02:00
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
2022-04-03 01:20:54 +02: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-04-03 01:20:53 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2022-04-03 01:20:54 +02:00
|
|
|
WSGI_APPLICATION = "ulm_cine_club_api.wsgi.application"
|
2022-04-03 01:20:53 +02:00
|
|
|
|
|
|
|
# Password validation
|
|
|
|
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
|
|
|
|
|
|
|
|
AUTH_PASSWORD_VALIDATORS = [
|
|
|
|
{
|
2022-04-03 01:20:54 +02:00
|
|
|
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
2022-04-03 01:20:53 +02:00
|
|
|
},
|
|
|
|
{
|
2022-04-03 01:20:54 +02:00
|
|
|
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
2022-04-03 01:20:53 +02:00
|
|
|
},
|
|
|
|
{
|
2022-04-03 01:20:54 +02:00
|
|
|
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
|
2022-04-03 01:20:53 +02:00
|
|
|
},
|
|
|
|
{
|
2022-04-03 01:20:54 +02:00
|
|
|
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
|
2022-04-03 01:20:53 +02:00
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
# Internationalization
|
|
|
|
# https://docs.djangoproject.com/en/3.2/topics/i18n/
|
|
|
|
|
2022-04-06 00:54:14 +02:00
|
|
|
LANGUAGE_CODE = "fr"
|
2022-04-03 01:20:53 +02:00
|
|
|
|
2022-04-03 01:20:54 +02:00
|
|
|
TIME_ZONE = "UTC"
|
2022-04-03 01:20:53 +02:00
|
|
|
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
USE_L10N = True
|
|
|
|
|
|
|
|
USE_TZ = True
|
|
|
|
|
2022-04-06 00:54:14 +02:00
|
|
|
# ManifestStaticFilesStorage is recommended in production, to prevent outdated
|
|
|
|
# JavaScript / CSS assets being served from cache (e.g. after a Wagtail upgrade).
|
|
|
|
# See https://docs.djangoproject.com/en/3.2/ref/contrib/staticfiles/#manifeststaticfilesstorage
|
|
|
|
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"
|
2022-04-03 01:20:53 +02:00
|
|
|
|
2022-04-06 00:54:14 +02:00
|
|
|
STATIC_ROOT = BASE_DIR / "static"
|
2022-04-03 01:20:54 +02:00
|
|
|
STATIC_URL = "/static/"
|
2022-04-03 01:20:53 +02:00
|
|
|
|
2022-04-06 00:54:14 +02:00
|
|
|
MEDIA_ROOT = BASE_DIR / "media"
|
|
|
|
MEDIA_URL = "/media/"
|
2022-04-03 01:20:53 +02:00
|
|
|
|
2022-04-03 01:20:54 +02:00
|
|
|
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
2022-04-03 01:20:54 +02:00
|
|
|
|
|
|
|
REST_FRAMEWORK = {
|
2022-04-06 00:54:14 +02:00
|
|
|
"DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.AllowAny",),
|
2022-04-03 01:20:54 +02:00
|
|
|
"DEFAULT_RENDERER_CLASSES": (
|
|
|
|
"djangorestframework_camel_case.render.CamelCaseJSONRenderer",
|
|
|
|
"djangorestframework_camel_case.render.CamelCaseBrowsableAPIRenderer",
|
|
|
|
),
|
|
|
|
"DEFAULT_PARSER_CLASSES": (
|
|
|
|
"djangorestframework_camel_case.parser.CamelCaseFormParser",
|
|
|
|
"djangorestframework_camel_case.parser.CamelCaseMultiPartParser",
|
|
|
|
"djangorestframework_camel_case.parser.CamelCaseJSONParser",
|
|
|
|
),
|
|
|
|
}
|