191 lines
4.7 KiB
Python
191 lines
4.7 KiB
Python
"""
|
|
Django settings for fet2020 project.
|
|
|
|
Generated by 'django-admin startproject' using Django 3.0.5.
|
|
|
|
For more information on this file, see
|
|
https://docs.djangoproject.com/en/3.0/topics/settings/
|
|
|
|
For the full list of settings and their values, see
|
|
https://docs.djangoproject.com/en/3.0/ref/settings/
|
|
"""
|
|
|
|
import os
|
|
|
|
# Prints and logs are written to console
|
|
# TODO: Change before release
|
|
LOGGING = {
|
|
'version': 1,
|
|
'disable_existing_loggers': False,
|
|
'handlers': {
|
|
'console': {
|
|
'class': 'logging.StreamHandler',
|
|
},
|
|
},
|
|
'root': {
|
|
'handlers': ['console'],
|
|
'level': 'DEBUG',
|
|
},
|
|
}
|
|
|
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
#SESSION_COOKIE_DOMAIN = ".2020.fet.at"
|
|
|
|
# Quick-start development settings - unsuitable for production
|
|
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
|
SECRET_KEY = 'r37-i7l)vrduzz2-gira+z#u!p!di9#f+%s*5-bb($hg)55@ns'
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
DEBUG = True
|
|
|
|
ALLOWED_HOSTS = []
|
|
|
|
DATA_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024 * 1024
|
|
# Application definition
|
|
CKEDITOR_UPLOAD_PATH = 'upload'
|
|
|
|
INSTALLED_APPS = [
|
|
'django.contrib.admin',
|
|
'django.contrib.admindocs',
|
|
'django.contrib.auth',
|
|
'django.contrib.contenttypes',
|
|
'django.contrib.sessions',
|
|
'django.contrib.messages',
|
|
'django.contrib.staticfiles',
|
|
'taggit',
|
|
'ckeditor',
|
|
'ckeditor_uploader',
|
|
'easy_thumbnails',
|
|
'rest_framework',
|
|
'django_filters',
|
|
'django_static_jquery_ui',
|
|
'accounts.apps.AccountsConfig',
|
|
'posts.apps.PostsConfig',
|
|
'members.apps.MembersConfig',
|
|
'documents.apps.DocumentsConfig',
|
|
]
|
|
|
|
MIDDLEWARE = [
|
|
'django.middleware.security.SecurityMiddleware',
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
'django.middleware.common.CommonMiddleware',
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
'fet2020.middleware.FETHeaderMiddleware',
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
]
|
|
|
|
ROOT_URLCONF = 'fet2020.urls'
|
|
|
|
TEMPLATES = [
|
|
{
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
'DIRS': [
|
|
os.path.join(BASE_DIR, 'templates'),
|
|
os.path.join(BASE_DIR, 'templates_design1')
|
|
],
|
|
'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 = 'fet2020.wsgi.application'
|
|
|
|
|
|
# Database
|
|
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
|
|
|
|
DATABASES = {
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
}
|
|
}
|
|
|
|
AUTHENTICATION_BACKENDS = [
|
|
'django.contrib.auth.backends.RemoteUserBackend',
|
|
]
|
|
|
|
# Password validation
|
|
# https://docs.djangoproject.com/en/3.0/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/3.0/topics/i18n/
|
|
|
|
LANGUAGE_CODE = 'de-at'
|
|
|
|
TIME_ZONE = 'CET'
|
|
|
|
USE_I18N = True
|
|
|
|
USE_L10N = True
|
|
|
|
USE_TZ = True
|
|
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
# https://docs.djangoproject.com/en/3.0/howto/static-files/
|
|
|
|
STATIC_URL = '/assets/'
|
|
|
|
STATICFILES_DIRS = [
|
|
os.path.join(BASE_DIR, "static"),
|
|
os.path.join(BASE_DIR, "static_design1"),
|
|
]
|
|
|
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'files/')
|
|
MEDIA_URL = '/files/'
|
|
|
|
TAGGIT_FORCE_LOWERCASE = True
|
|
|
|
CKEDITOR_CONFIGS = {
|
|
'default': {
|
|
'stylesSet': [
|
|
{
|
|
"name": 'Überschrift 2',
|
|
"element": 'h2',
|
|
"attributes": {},
|
|
},
|
|
{
|
|
"name": 'Code',
|
|
"element": 'code',
|
|
"attributes": {"class": "code-block"},
|
|
},
|
|
],
|
|
}
|
|
}
|
|
THUMBNAIL_ALIASES = {
|
|
'': {
|
|
'avatar': {'size': (50, 50), 'crop': True},
|
|
'thumb': {'size': (150, 150), 'crop': True},
|
|
},
|
|
} |