From 772bf5a83e666e39933471024b17672da1c65446 Mon Sep 17 00:00:00 2001 From: dcz <dcz@ipipan.waw.pl> Date: Tue, 5 Apr 2022 12:28:27 +0200 Subject: [PATCH] +settings.py --- shellvalier/settings.py | 155 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 shellvalier/settings.py diff --git a/shellvalier/settings.py b/shellvalier/settings.py new file mode 100644 index 0000000..f17b5f2 --- /dev/null +++ b/shellvalier/settings.py @@ -0,0 +1,155 @@ +""" +Django settings for ShellValier project. + +Generated by 'django-admin startproject' using Django 2.1. + +For more information on this file, see +https://docs.djangoproject.com/en/2.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/2.1/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'xxx' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +# for production +''' +SECURE_CONTENT_TYPE_NOSNIFF = True +SECURE_BROWSER_XSS_FILTER = True +SESSION_COOKIE_SECURE = True +CSRF_COOKIE_SECURE = True +X_FRAME_OPTIONS = 'DENY' +''' + +ALLOWED_HOSTS = ['127.0.0.1'] + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'common.apps.CommonConfig', + 'connections.apps.ConnectionsConfig', + 'examples.apps.ExamplesConfig', + 'meanings.apps.MeaningsConfig', + 'semantics.apps.SemanticsConfig', + 'syntax.apps.SyntaxConfig', + 'entries.apps.EntriesConfig', + 'phrase_expansions.apps.PhraseExpansionsConfig', + 'dictionary_statistics.apps.DictionaryStatisticsConfig', + 'download.apps.DownloadConfig', + 'crispy_forms', +] + +CRISPY_TEMPLATE_PACK = 'bootstrap4' +CRISPY_FAIL_SILENTLY = not DEBUG + +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', + 'django.middleware.locale.LocaleMiddleware', +] + +ROOT_URLCONF = 'shellvalier.urls' + +TEMPLATES = [ + { + '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', + ], + }, + }, +] + +WSGI_APPLICATION = 'shellvalier.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/2.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': 'shellvalier', + 'USER': 'shellvalier', + 'PASSWORD': 'shellvalier', + 'HOST': 'localhost', + 'PORT': '', + }} + + +# Password validation +# https://docs.djangoproject.com/en/2.1/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/2.1/topics/i18n/ + +LANGUAGE_CODE = 'pl' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + +LOCALE_PATHS = [ + 'locale', +] + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/2.1/howto/static-files/ + +STATIC_URL = '/static/' + +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, 'common/static/'), +] + -- GitLab