Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
eoa2-xmldb/src/website/settings.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
186 lines (143 sloc)
4.74 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Django settings for website project. | |
Generated by 'django-admin startproject' using Django 2.1.5. | |
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 | |
from pathlib import Path | |
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) | |
BASE_DIR = Path(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
RES_DIR = Path(os.environ['RES_DIR']) | |
INPUT_DIR = RES_DIR / "input" | |
XML_DIR = RES_DIR / "xml" | |
PUBL_STATIC_DIR = RES_DIR / "static" / "publications" | |
# 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 = 'tx=f^w9f7b00%)6h88_9ci)nnk1v6#^s#ww0ix7&9m%l#35-9p' | |
# SECURITY WARNING: don't run with debug turned on in production! | |
DEBUG = True | |
ALLOWED_HOSTS = [] | |
# Application definition | |
INSTALLED_APPS = [ | |
'djangocms_admin_style', # needed by django cms | |
'django.contrib.admin', | |
'django.contrib.auth', | |
'django.contrib.contenttypes', | |
'django.contrib.sessions', | |
'django.contrib.messages', | |
'django.contrib.staticfiles', | |
'pyexistdb', | |
# django cms config: | |
'django.contrib.sites', | |
'cms', | |
'menus', | |
'treebeard', | |
'sekizai', # cms static files | |
# main app: | |
'website' | |
] | |
SITE_ID = 1 | |
LANGUAGES = [ | |
('en', 'English'), | |
('de', 'Deutsch'), | |
('it', 'Italiano'), | |
('fr', 'Français'), | |
] | |
CMS_TEMPLATES = [ | |
('base.html', 'Home page template'), | |
] | |
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', | |
# needed by django-cms: | |
'django.middleware.locale.LocaleMiddleware', | |
'cms.middleware.user.CurrentUserMiddleware', | |
'cms.middleware.page.CurrentPageMiddleware', | |
'cms.middleware.toolbar.ToolbarMiddleware', | |
'cms.middleware.language.LanguageCookieMiddleware', | |
'cms.middleware.utils.ApphookReloadMiddleware', | |
] | |
ROOT_URLCONF = 'website.urls' | |
TEMPLATES = [ | |
{ | |
'BACKEND': 'django.template.backends.django.DjangoTemplates', | |
'DIRS': [Path(BASE_DIR, 'website', 'templates'),], | |
'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', | |
# needed by django-cms: | |
'sekizai.context_processors.sekizai', | |
'cms.context_processors.cms_settings', | |
'django.template.context_processors.i18n', | |
], | |
}, | |
}, | |
] | |
WSGI_APPLICATION = 'website.wsgi.application' | |
# Database | |
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql', | |
'NAME': 'postgres', | |
'USER': 'postgres', | |
'HOST': 'db', | |
'PORT': '5432', | |
} | |
} | |
# DATABASES = { | |
# 'default': { | |
# 'ENGINE': 'django.db.backends.sqlite3', | |
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), | |
# } | |
# } | |
# 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 = 'en' | |
TIME_ZONE = 'UTC' | |
USE_I18N = True | |
USE_L10N = True | |
USE_TZ = True | |
# Static files (CSS, JavaScript, Images) | |
# https://docs.djangoproject.com/en/2.1/howto/static-files/ | |
STATIC_URL = '/static/' | |
STATIC_ROOT = RES_DIR / 'all_static_files' | |
# (where all static files are collected by 'python manage.py collectstatic') | |
STATICFILES_DIRS = [ | |
PUBL_STATIC_DIR, | |
RES_DIR / "static" / "webdesign_platform", | |
] | |
# Exist DB Settings | |
EXISTDB_SERVER_URL = "http://xmldb:8080/exist" | |
EXISTDB_SERVER_USER = 'admin' | |
EXISTDB_SERVER_PASSWORD = '' | |
# EXISTDB_ROOT_COLLECTION = ? |