forked from armada-ths/ais
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local_settings2.py
46 lines (36 loc) · 1.3 KB
/
local_settings2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
This is the settings file to be used in a production environment. It's
more secure, more robust and more performant than the development setup
and also configures AIS to talk to external services (e.g. CAS).
"""
import os
from os import environ as env
from ais.common.settings import *
from ais.secrets import *
DEBUG=True
# This is important so other people can't set their own domains
# to point to AIS (which would be a security concern).
ALLOWED_HOSTS = ['.armada.nu', 'localhost']
# The URL scheme is slightly different in a production environment
# since we need to accomodate the CAS integration.
ROOT_URLCONF = 'ais.production.urls'
# Use KTH CAS for authentication
INSTALLED_APPS += ('cas', 'raven.contrib.django.raven_compat',)
AUTHENTICATION_BACKENDS += ('cas.backends.CASBackend',)
CAS_SERVER_URL = 'https://login.kth.se/'
CAS_AUTO_CREATE_USER = False
CAS_RESPONSE_CALLBACKS = ('lib.CAS_callback.callback',)
# Use a full-fledged database instead of SQLite.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': DB_NAME,
'USER': DB_USERNAME,
'PASSWORD': DB_PASSWORD,
'HOST': DB_HOST,
}
}
# The system sends out system-related emails to these addresses.
ADMINS = MANAGERS = (
('System', '[email protected]'),
)