nk20/note_kfet/settings/production.py

55 lines
1.4 KiB
Python
Raw Normal View History

2020-02-18 20:30:26 +00:00
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
import os
########################
# Production Settings #
########################
# For local dev on your machine:
# - Enabled by setting env variable DJANGO_APP_STAGE = 'prod'
# - use Postgresql as db engine
# - Debug should be false.
# - should have a dedicated mail server
# - and more ...
DATABASES = {
'default': {
2020-01-28 19:56:04 +00:00
'ENGINE': 'django.db.backends.postgresql_psycopg2',
2020-01-27 21:23:40 +00:00
'NAME': 'note_db',
'USER': 'note',
2020-01-28 19:56:04 +00:00
'PASSWORD': 'update_in_env_variable',
'HOST': '127.0.0.1',
2020-01-27 21:23:40 +00:00
'PORT': '',
}
}
# Break it, fix it!
DEBUG = True
# Mandatory !
2020-03-07 22:55:35 +00:00
ALLOWED_HOSTS = []
# Emails
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# EMAIL_USE_SSL = False
# EMAIL_HOST = 'smtp.example.org'
# EMAIL_PORT = 25
# EMAIL_HOST_USER = 'change_me'
# EMAIL_HOST_PASSWORD = 'change_me'
2020-03-11 14:13:34 +00:00
SERVER_EMAIL = 'no-reply@' + os.getenv("DOMAIN", "example.com")
# Security settings
SECURE_CONTENT_TYPE_NOSNIFF = False
SECURE_BROWSER_XSS_FILTER = False
SESSION_COOKIE_SECURE = False
CSRF_COOKIE_SECURE = False
CSRF_COOKIE_HTTPONLY = False
X_FRAME_OPTIONS = 'DENY'
SESSION_COOKIE_AGE = 60 * 60 * 3
2020-02-22 22:44:24 +00:00
# CAS Client settings
2020-03-11 14:13:34 +00:00
CAS_SERVER_URL = "https://" + os.getenv("NOTE_URL", "note.example.com") + "/cas/"