3 PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
8 os.environ.get('ADMINS', '').split('\n')
15 os.environ.get('MANAGERS', os.environ.get('ADMINS', '')).split('\n')
21 if 'DB_NAME' in os.environ:
24 'ENGINE': 'django.db.backends.postgresql_psycopg2',
25 'NAME': os.environ['DB_NAME'],
26 'USER': os.environ.get('DB_USER', ''),
27 'PASSWORD': os.environ.get('DB_PASSWORD', ''),
28 'HOST': os.environ.get('DB_HOST', ''),
29 'PORT': os.environ.get('DB_PORT', ''),
37 'ENGINE': 'django.db.backends.sqlite3',
38 'NAME': '/app/src/cas/dev.sqlite',
43 DEBUG = os.environ.get('DEBUG', str(DEBUG)).lower() == 'true'
45 EMAIL_HOST = os.environ.get('EMAIL_HOST', 'localhost')
46 DEFAULT_FROM_EMAIL = os.environ.get('DEFAULT_FROM_EMAIL', '')
47 EMAIL_SUBJECT_PREFIX = os.environ.get('EMAIL_SUBJECT_PREFIX', '')
48 SECRET_KEY = os.environ.get('SECRET_KEY', '')
49 ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split()
50 EMAILS_BASE_DOMAINS = os.environ.get('EMAILS_BASE_DOMAINS', '').split()
51 SECURE_PROXY_SSL_HEADER = os.environ.get('SECURE_PROXY_SSL_HEADER', '').split()
53 # Local time zone for this installation. Choices can be found here:
54 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
55 # although not all choices may be available on all operating systems.
56 # If running in a Windows environment this must be set to the same as your
58 TIME_ZONE = os.environ.get('TIME_ZONE', 'Europe/Warsaw')
60 # Language code for this installation. All choices can be found here:
61 # http://www.i18nguy.com/unicode/language-identifiers.html
62 LANGUAGE_CODE = os.environ.get('LANGUAGE_CODE', 'pl')
66 # If you set this to False, Django will make some optimizations so as not
67 # to load the internationalization machinery.
72 # Absolute path to the directory that holds media.
73 # Example: "/home/media/media.lawrence.com/"
74 MEDIA_ROOT = '/app/media/'
76 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
77 # trailing slash if there is a path component (optional in other cases).
78 # Examples: "http://media.lawrence.com", "http://example.com/media/"
81 STATIC_ROOT = '/app/static/'
82 STATIC_URL = '/static/'
86 SESSION_COOKIE_NAME = 'fnpcas'
88 GRAVATAR_DEFAULT_IMAGE = 'mm'
89 GRAVATAR_URL_PREFIX = 'https://www.gravatar.com/'
91 SITE_TITLE = 'Fundacja Wolne Lektury'
94 # Import localsettings file, which may override settings defined here
96 from .localsettings import *
102 DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
105 os.path.join(PROJECT_ROOT, 'static'),
108 ROOT_URLCONF = 'cas.urls'
112 'BACKEND': 'django.template.backends.django.DjangoTemplates',
115 PROJECT_ROOT + '/templates',
118 'context_processors': [
119 "django.contrib.auth.context_processors.auth",
120 "django.template.context_processors.debug",
121 "django.template.context_processors.i18n",
122 "django.template.context_processors.media",
123 "django.template.context_processors.static",
124 "django.template.context_processors.tz",
125 "django.contrib.messages.context_processors.messages",
126 "django.template.context_processors.request",
134 PROJECT_ROOT + '/locale',
138 'accounts.apps.AccountsConfig',
139 'emails.apps.EmailsConfig',
141 'services.apps.ServicesConfig',
142 'ssh_keys.apps.SshKeysConfig',
148 'django.contrib.auth',
149 'django.contrib.contenttypes',
150 'django.contrib.messages',
151 'django.contrib.sessions',
152 'django.contrib.sites',
153 'django.contrib.admin',
154 'django.contrib.admindocs',
155 'django.contrib.staticfiles',
159 'django.contrib.sessions.middleware.SessionMiddleware',
160 'django.middleware.common.CommonMiddleware',
161 'django.middleware.csrf.CsrfViewMiddleware',
162 'django.contrib.auth.middleware.AuthenticationMiddleware',
163 'django.contrib.messages.middleware.MessageMiddleware',
164 'django.middleware.clickjacking.XFrameOptionsMiddleware',
167 # django-cas-provider settings
168 LOGIN_URL = '/cas/login'
169 LOGOUT_URL = '/cas/logout'
170 LOGIN_REDIRECT_URL = '/accounts/'
171 CAS_CUSTOM_ATTRIBUTES_CALLBACK = 'cas.utils.custom_attributes_callback'
174 OIDC_USERINFO = 'emails.oidc.userinfo'
177 'cas.hashers.FNPBCryptPasswordHasher',
181 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
182 ALLOWED_HOSTS = ALLOWED_HOSTS or ['*']
183 SECRET_KEY = SECRET_KEY or 'dev-secret-key'