Skip to content

Commit

Permalink
chore: add settings.py.example
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoesbergen committed Feb 5, 2024
1 parent bd25049 commit 6bc243a
Showing 1 changed file with 146 additions and 0 deletions.
146 changes: 146 additions & 0 deletions corvee/settings.py.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
"""
Django settings for corvee project.

Generated by 'django-admin startproject' using Django 2.1.7.

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 = 'verysecretlsdkjfksdljfksdljfklsdjfklsdjklf'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'corvee.src'
]

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',
]

ROOT_URLCONF = 'corvee.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'corvee', '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',
],
},
},
]

WSGI_APPLICATION = 'corvee.wsgi.application'


# Database
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases

DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "corvee",
}
}

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

# 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-us'
TIME_ZONE = 'Europe/Amsterdam'
USE_I18N = True
USE_L10N = True
USE_TZ = True


# IDP Settings
LOGIN_REDIRECT_URL='/main/'
IDP_CLIENT_ID = 'henk'
IDP_CLIENT_SECRET = 'secret'
IDP_REDIRECT_URL = 'https://corvee.djoamersfoort.nl/oauth/'
IDP_AUTHORIZE_URL = 'https://leden.djoamersfoort.nl/o/authorize/'
IDP_TOKEN_URL = 'https://leden.djoamersfoort.nl/o/token/'
IDP_API_URL = 'https://leden.djoamersfoort.nl/api/v1/member/details'
IDP_REQUIRED_ROLES = ['begeleider', 'bestuur', 'ondersteuning']
IDP_SCOPES = ['user/basic', 'user/names']

SESSION_EXPIRE_AT_BROWSER_CLOSE = True
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
CSRF_TRUSTED_ORIGINS = ["https://corvee.djoamersfoort.nl"]

LEDEN_ADMIN_API_URL = 'https://leden.djoamersfoort.nl/api/v1/smoelenboek/?large=1'
PRESENCE_API_URL = 'https://aanmelden.djoamersfoort.nl'
BACKEND_CLIENT_ID = 'aaa'
BACKEND_CLIENT_SECRET = 'bbb'

# Days a person won't be picked after being marked OK
ABSOLVE_DAYS = 31

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = '/srv/static'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "corvee", "static"),
)

0 comments on commit 6bc243a

Please sign in to comment.