Skip to content
Permalink
ae80ca2d14
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
206 lines (164 sloc) 5.35 KB
"""
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__))))
try:
RES_DIR = Path(os.environ['RES_DIR'])
USE_DOCKER = True
except KeyError:
RES_DIR = Path(Path(os.path.dirname(BASE_DIR)) / "res")
USE_DOCKER = False
INPUT_DIR = RES_DIR / "input"
XML_DIR = RES_DIR / "xml"
# xml files are stored here:
XML_INPUT_DIR = XML_DIR / "xml_files"
# xml stylesheets are stored here:
XML_STYLESHEET_DIR = XML_DIR / "stylesheets"
# publications xml files are stored here:
PUBL_XML_DIR = RES_DIR / "publications"
PUBL_STATIC_DIR = RES_DIR / "all_static_files" / "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.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
# 'django.contrib.sitemaps',
'django.contrib.staticfiles',
'django.contrib.messages',
'cms',
'menus',
'sekizai', # cms static files
'treebeard',
'pyexistdb',
'djangocms_text_ckeditor',
# django cms config:
'filer',
'easy_thumbnails',
'djangocms_file',
'djangocms_link',
'djangocms_picture',
'djangocms_style',
'djangocms_snippet',
'djangocms_video',
'aldryn_apphooks_config',
# main app:
'website',
'xsl',
'eoaseries2',
'eoaauthors2',
]
SITE_ID = 1
LANGUAGES = [
('en', 'English'),
# ('de', 'Deutsch'),
# ('it', 'Italiano'),
# ('fr', 'Français'),
]
CMS_TEMPLATES = [
('fullwidth.html', 'Fullwidth'),
]
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.sqlite3',
'NAME': 'project.db'
}
}
# 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/'
# (where all static files are collected by 'python manage.py collectstatic')
STATIC_ROOT = RES_DIR / 'all_static_files'
MEDIA_URL = '/media/'
MEDIA_ROOT = RES_DIR / 'all_media_files'
STATICFILES_DIRS = [
PUBL_STATIC_DIR,
STATIC_ROOT / "webdesign_platform",
]
# Exist DB Settings
if USE_DOCKER:
EXISTDB_SERVER_URL = "http://xmldb:8080/exist"
else:
EXISTDB_SERVER_URL = "http://localhost:8080/exist"
EXISTDB_SERVER_USER = 'admin'
EXISTDB_SERVER_PASSWORD = ''
# EXISTDB_ROOT_COLLECTION = '/db/xml_files/publications'