summaryrefslogtreecommitdiff
path: root/selfserv/settings.example.py
blob: bae58013e011365aaee6644df40970c384d00a0c (plain)
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
1#	Society Self-Service
2#	Copyright © 2018-2019  Yingtong Li (RunasSudo)
3#
4#	This program is free software: you can redistribute it and/or modify
5#	it under the terms of the GNU Affero General Public License as published by
6#	the Free Software Foundation, either version 3 of the License, or
7#	(at your option) any later version.
8#
9#	This program is distributed in the hope that it will be useful,
10#	but WITHOUT ANY WARRANTY; without even the implied warranty of
11#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12#	GNU Affero General Public License for more details.
13#
14#	You should have received a copy of the GNU Affero General Public License
15#	along with this program.  If not, see <https://www.gnu.org/licenses/>.
16
17import os
18
19BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
20
21
22SECRET_KEY = None # IMPORTANT: Set this to a secret string
23SECRET_KEY_MEMBERSIG = None # IMPORTANT: Set this to a secret string
24
25DEBUG = True
26EMAIL_DEBUG = False
27
28ALLOWED_HOSTS = []
29
30ORG_NAME = 'Society'
31PROMO_LOGO_URL = 'https://placehold.it/2000x500'
32PROMO_LOGO_LINK = 'https://example.com'
33PROMO_GROUPS_MANDATORY = ['All Years']
34
35ABA_USER_NAME = 'Society Name'
36ABA_BANK_NAME = 'CBA'
37ABA_BANK_CODE = 0
38ABA_SRC_BSB = '000-000'
39ABA_SRC_ACC = '00000000'
40
41# Download from http://bsb.apca.com.au/
42BSB_FILE_PATH = 'sstreasury/BSBDirectoryMay20-290.csv'
43
44# Application definition
45
46INSTALLED_APPS = [
47	'ssmain',
48	'sstreasury',
49	'ssmembership',
50	'sspromotions',
51	'django.contrib.admin',
52	'django.contrib.auth',
53	'django.contrib.contenttypes',
54	'django.contrib.sessions',
55	'django.contrib.messages',
56	'django.contrib.staticfiles',
57	'social_django',
58]
59
60MIDDLEWARE = [
61	'django.middleware.security.SecurityMiddleware',
62	'django.contrib.sessions.middleware.SessionMiddleware',
63	'django.middleware.common.CommonMiddleware',
64	'django.middleware.csrf.CsrfViewMiddleware',
65	'django.contrib.auth.middleware.AuthenticationMiddleware',
66	'django.contrib.messages.middleware.MessageMiddleware',
67	'django.middleware.clickjacking.XFrameOptionsMiddleware',
68]
69
70ROOT_URLCONF = 'selfserv.urls'
71
72TEMPLATES = [
73	{
74		'BACKEND': 'django.template.backends.jinja2.Jinja2',
75		'DIRS': [],
76		'APP_DIRS': True,
77		'OPTIONS': {
78			'environment': 'selfserv.jinja2.environment'
79		}
80	},
81	{
82		'BACKEND': 'django.template.backends.django.DjangoTemplates',
83		'DIRS': [],
84		'APP_DIRS': True,
85		'OPTIONS': {
86			'context_processors': [
87				'django.template.context_processors.debug',
88				'django.template.context_processors.request',
89				'django.contrib.auth.context_processors.auth',
90				'django.contrib.messages.context_processors.messages',
91				'social_django.context_processors.backends',
92				'social_django.context_processors.login_redirect',
93			],
94		},
95	},
96]
97
98WSGI_APPLICATION = 'selfserv.wsgi.application'
99
100
101# Database
102# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
103
104DATABASES = {
105	'default': {
106		'ENGINE': 'django.db.backends.sqlite3',
107		'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
108	}
109}
110
111
112# Password validation
113# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
114
115AUTH_PASSWORD_VALIDATORS = [
116	{
117		'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
118	},
119	{
120		'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
121	},
122	{
123		'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
124	},
125	{
126		'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
127	},
128]
129
130AUTHENTICATION_BACKENDS = (
131	'social_core.backends.google.GoogleOAuth2',
132
133	'django.contrib.auth.backends.ModelBackend',
134)
135LOGIN_URL = 'login'
136LOGIN_REDIRECT_URL = 'index'
137SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = None # FIXME
138SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = None # FIXME
139#SOCIAL_AUTH_GOOGLE_OAUTH2_AUTH_EXTRA_ARGUMENTS = {'hd': 'monash.edu'} # To restrict to a particular domain
140
141GOOGLE_API_KEY = None # FIXME
142GOOGLE_CALENDAR_ID = None # FIXME
143
144AWS_KEY_ID = None # FIXME
145AWS_SECRET = None # FIXME
146AWS_REGION = 'us-east-1'
147AWS_SENDER_EMAIL = 'example@example.com'
148
149RATELIMIT_KEY = 'ip' # https://django-ratelimit.readthedocs.io/en/stable/keys.html#common-keys e.g. 'header:CF-Connecting-IP'
150
151SOCIAL_AUTH_PIPELINE = (
152	'social_core.pipeline.social_auth.social_details',
153	'social_core.pipeline.social_auth.social_uid',
154	'social_core.pipeline.social_auth.social_user',
155	'social_core.pipeline.user.get_username',
156	'social_core.pipeline.social_auth.associate_by_email',
157	'social_core.pipeline.user.create_user',
158	'social_core.pipeline.social_auth.associate_user',
159	'social_core.pipeline.social_auth.load_extra_data',
160	'social_core.pipeline.user.user_details',
161	'social_core.pipeline.social_auth.associate_by_email',
162)
163
164# Internationalization
165# https://docs.djangoproject.com/en/2.0/topics/i18n/
166
167LANGUAGE_CODE = 'en-us'
168
169TIME_ZONE = 'Australia/Melbourne'
170
171USE_I18N = True
172
173USE_L10N = True
174
175USE_TZ = True
176
177
178# Static files (CSS, JavaScript, Images)
179# https://docs.djangoproject.com/en/2.0/howto/static-files/
180
181STATIC_URL = '/static/'
182
183MEDIA_ROOT = ''
184MEDIA_URL = '/media/'
Contact (issues, pull requests, etc.) at git@yingtongli.me. Generated by cgit.