This repository was archived by the owner on Aug 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsettings.py
More file actions
279 lines (247 loc) · 8.82 KB
/
settings.py
File metadata and controls
279 lines (247 loc) · 8.82 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# -*- coding: utf-8 -*-
# Globally defined Karaage settings
# These settings will be used for karaage-admin and karaage-registration.
# Some of these values have sensible defaults. Settings that don't have a
# sensible default must be configured manually.
# Other Django settings are also possible, this list is not a comprehensive
# list of all settings.
#
# Django settings
#
# A boolean that turns on/off debug mode.
#
# Never deploy a site into production with DEBUG turned on.
#
# Did you catch that? NEVER deploy a site into production with DEBUG turned on.
#
# One of the main features of debug mode is the display of detailed error
# pages. If your app raises an exception when DEBUG is True, Django will
# display a detailed traceback, including a lot of metadata about your
# environment, such as all the currently defined Django settings (from
# settings.py).
#
# default: DEBUG = False
#
# DEBUG = True
# FQDN host, used in default settings for :setting:`ALLOWED_HOSTS`,
# :setting:`REGISTRATION_BASE_URL`, and :setting:`ADMIN_BASE_URL`.
#
# default: HTTP_HOST = FQDN hostname
#
# HTTP_HOST = "localhost"
HTTP_HOST = "localhost"
# A list of strings representing the host/domain names that this Django site
# can serve. This is a security measure to prevent an attacker from poisoning
# caches and password reset emails with links to malicious hosts by submitting
# requests with a fake HTTP Host header, which is possible even under many
# seemingly-safe web server configurations.
#
# %(HOST) will be substituted with the HTTP_HOST setting.
#
# default: ALLOWED_HOSTS = ["%(HOST)s"]
#
# ALLOWED_HOSTS = ["www.example.org"]
# Whether to use a secure cookie for the session cookie. If this is set to
# True, the cookie will be marked as “secure,” which means browsers may ensure
# that the cookie is only sent under an HTTPS connection.
#
# default: SESSION_COOKIE_SECURE = True
#
SESSION_COOKIE_SECURE = False
# A tuple that lists people who get code error notifications. When DEBUG=False
# and a view raises an exception, Django will email these people with the full
# exception information. Each member of the tuple should be a tuple of (Full
# name, email address).
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
# A tuple in the same format as ADMINS that specifies who should get broken
# link notifications when BrokenLinkEmailsMiddleware is enabled.
MANAGERS = ADMINS
# A dictionary containing the settings for all databases to be used with
# Django. It is a nested dictionary whose contents maps database aliases to a
# dictionary containing the options for an individual database.
# The email address that error messages come from, such as those sent to ADMINS
# and MANAGERS.
SERVER_EMAIL = 'karaage@example.org'
# The host to use for sending email.
EMAIL_HOST = 'localhost'
# Subject-line prefix for email messages sent with django.core.mail.mail_admins
# or django.core.mail.mail_managers. You’ll probably want to include the
# trailing space.
EMAIL_SUBJECT_PREFIX = '[Karaage] - '
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Australia/Melbourne'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-au'
# A secret key for a particular Django installation. This is used to provide
# cryptographic signing, and should be set to a unique, unpredictable value.
SECRET_KEY = ''
# A data structure containing configuration information. The contents of this
# data structure will be passed as the argument to the configuration method
# described in LOGGING_CONFIG.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s '
'%(module)s %(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
},
'django_file': {
'level': 'WARNING',
'class': 'karaage.logging.FileHandler',
'filename': '/var/log/karaage3/django.log',
'formatter': 'verbose',
'owner': ['www-data', 'www-data'],
},
'karaage_file': {
'level': 'WARNING',
'class': 'karaage.logging.FileHandler',
'filename': '/var/log/karaage3/karaage.log',
'formatter': 'verbose',
'owner': ['www-data', 'www-data'],
},
# 'ldap_file': {
# 'level': 'DEBUG',
# 'class': 'karaage.logging.FileHandler',
# 'filename': '/var/log/karaage3/ldap.log',
# 'formatter': 'verbose',
# 'owner': ['www-data', 'www-data'],
# },
# 'gold_file': {
# 'level': 'DEBUG',
# 'class': 'karaage.logging.FileHandler',
# 'filename': '/var/log/karaage3/gold.log',
# 'formatter': 'verbose',
# 'owner': ['www-data', 'www-data'],
# },
# 'slurm_file': {
# 'level': 'DEBUG',
# 'class': 'karaage.logging.FileHandler',
# 'filename': '/var/log/karaage3/slurm.log',
# 'formatter': 'verbose',
# 'owner': ['www-data', 'www-data'],
# },
},
'loggers': {
'': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
'django': {
'handlers': ['django_file'],
'level': 'DEBUG',
'propagate': True,
},
'karaage': {
'handlers': ['karaage_file'],
'level': 'DEBUG',
'propagate': True,
},
# 'karaage.datastores.ldap': {
# 'handlers': ['ldap_file'],
# 'level': 'DEBUG',
# 'propagate': True,
# },
# 'karaage.datastores.gold': {
# 'handlers': ['gold_file'],
# 'level': 'DEBUG',
# 'propagate': True,
# },
# 'karaage.datastores.slurm': {
# 'handlers': ['slurm_file'],
# 'level': 'DEBUG',
# 'propagate': True,
# },
},
}
#
# Karaage settings
#
# Users are advised to contact this address if having problems.
# This is also used as the from address in outgoing emails.
ACCOUNTS_EMAIL = 'accounts@example.com'
# This organisation name, used in outgoing emails.
ACCOUNTS_ORG_NAME = 'Example'
# Registration base URL - Used in email templates
# Uncomment to override default
#
# %(HOST) will be substituted with the HTTP_HOST setting.
#
# default: REGISTRATION_BASE_URL = 'https://%(HOST)s/users'
#
# REGISTRATION_BASE_URL = 'https://accounts.example.org/users'
# Admin base URL - Used in email templates
# Uncomment to override default
#
# %(HOST) will be substituted with the HTTP_HOST setting.
#
# default: ADMIN_BASE_URL = 'https://%(HOST)s/kgadmin'
#
# ADMIN_BASE_URL = 'https://accounts.example.org/kgadmin'
# Is Shibboleth supported?
#
# default: SHIB_SUPPORTED = False
#
# SHIB_SUPPORTED = True
# Path to AUP policy. Note that setting this will not disable the Karaage
# default page, it might be better to replace the AUP with a file in
# the templates directory ``karaage/common/aup-detail.html`` if required.
#
# default: Django template ``karaage/common/aup-detail.html``
#
# AUP_URL = "https://site.example.org/users/aup/"
# Do we allow anonymous users to request accounts?
#
# default: ALLOW_REGISTRATIONS = False
#
# ALLOW_REGISTRATIONS = True
# Do we allow any logged in user to access all usage information?
#
# default: USAGE_IS_PUBLIC = True
#
# USAGE_IS_PUBLIC = False
# Settings to restrict the valid list of email addresses we allow in
# applications. EMAIL_MATCH_TYPE can be "include" or "exclude". If "include"
# then the email address must match one of the RE entries in EMAIL_MATCH_LIST.
# If "exclude" then then email address must not match of the the RE entries in
# EMAIL_MATCH_LIST.
#
# default: allow any email address
#
# EMAIL_MATCH_TYPE="include"
# EMAIL_MATCH_LIST=["@vpac.org$", "@v3.org.au$", "^tux@.*au$"]
# List of Karaage plugins
#
# default: PLUGINS = []
#
# PLUGINS = [
# 'karaage.plugins.kgapplications.plugin',
# 'karaage.plugins.kgsoftware.plugin',
# 'karaage.plugins.kgsoftware.applications.plugin',
# 'karaage.plugins.kgusage.plugin',
# ]
PLUGINS = [
'karaage.plugins.kgapplications.plugin',
'karaage.plugins.kgsoftware.plugin',
'karaage.plugins.kgsoftware.applications.plugin',
'karaage.plugins.kgusage.plugin',
]
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# Test settings