summaryrefslogtreecommitdiff
path: root/selfserv/settings.example.py
blob: 4c53afb7bdb65dc57ce5faf08c39f4656240cf2e (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
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# Application definition
42
43INSTALLED_APPS = [
44	'ssmain',
45	'sstreasury',
46	'ssmembership',
47	'sspromotions',
48	'django.contrib.admin',
49	'django.contrib.auth',
50	'django.contrib.contenttypes',
51	'django.contrib.sessions',
52	'django.contrib.messages',
53	'django.contrib.staticfiles',
54	'social_django',
55]
56
57MIDDLEWARE = [
58	'django.middleware.security.SecurityMiddleware',
59	'django.contrib.sessions.middleware.SessionMiddleware',
60	'django.middleware.common.CommonMiddleware',
61	'django.middleware.csrf.CsrfViewMiddleware',
62	'django.contrib.auth.middleware.AuthenticationMiddleware',
63	'django.contrib.messages.middleware.MessageMiddleware',
64	'django.middleware.clickjacking.XFrameOptionsMiddleware',
65]
66
67ROOT_URLCONF = 'selfserv.urls'
68
69TEMPLATES = [
70	{
71		'BACKEND': 'django.template.backends.jinja2.Jinja2',
72		'DIRS': [],
73		'APP_DIRS': True,
74		'OPTIONS': {
75			'environment': 'selfserv.jinja2.environment'
76		}
77	},
78	{
79		'BACKEND': 'django.template.backends.django.DjangoTemplates',
80		'DIRS': [],
81		'APP_DIRS': True,
82		'OPTIONS': {
83			'context_processors': [
84				'django.template.context_processors.debug',
85				'django.template.context_processors.request',
86				'django.contrib.auth.context_processors.auth',
87				'django.contrib.messages.context_processors.messages',
88				'social_django.context_processors.backends',
89				'social_django.context_processors.login_redirect',
90			],
91		},
92	},
93]
94
95WSGI_APPLICATION = 'selfserv.wsgi.application'
96
97
98# Database
99# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
100
101DATABASES = {
102	'default': {
103		'ENGINE': 'django.db.backends.sqlite3',
104		'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
105	}
106}
107
108
109# Password validation
110# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
111
112AUTH_PASSWORD_VALIDATORS = [
113	{
114		'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
115	},
116	{
117		'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
118	},
119	{
120		'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
121	},
122	{
123		'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
124	},
125]
126
127AUTHENTICATION_BACKENDS = (
128	'social_core.backends.google.GoogleOAuth2',
129
130	'django.contrib.auth.backends.ModelBackend',
131)
132LOGIN_URL = 'login'
133LOGIN_REDIRECT_URL = 'index'
134SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = None # FIXME
135SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = None # FIXME
136#SOCIAL_AUTH_GOOGLE_OAUTH2_AUTH_EXTRA_ARGUMENTS = {'hd': 'monash.edu'} # To restrict to a particular domain
137
138GOOGLE_API_KEY = None # FIXME
139GOOGLE_CALENDAR_ID = None # FIXME
140
141AWS_KEY_ID = None # FIXME
142AWS_SECRET = None # FIXME
143AWS_REGION = 'us-east-1'
144AWS_SENDER_EMAIL = 'example@example.com'
145
146RATELIMIT_KEY = 'ip' # https://django-ratelimit.readthedocs.io/en/stable/keys.html#common-keys e.g. 'header:CF-Connecting-IP'
147
148SOCIAL_AUTH_PIPELINE = (
149	'social_core.pipeline.social_auth.social_details',
150	'social_core.pipeline.social_auth.social_uid',
151	'social_core.pipeline.social_auth.social_user',
152	'social_core.pipeline.user.get_username',
153	'social_core.pipeline.social_auth.associate_by_email',
154	'social_core.pipeline.user.create_user',
155	'social_core.pipeline.social_auth.associate_user',
156	'social_core.pipeline.social_auth.load_extra_data',
157	'social_core.pipeline.user.user_details',
158	'social_core.pipeline.social_auth.associate_by_email',
159)
160
161# Internationalization
162# https://docs.djangoproject.com/en/2.0/topics/i18n/
163
164LANGUAGE_CODE = 'en-us'
165
166TIME_ZONE = 'Australia/Melbourne'
167
168USE_I18N = True
169
170USE_L10N = True
171
172USE_TZ = True
173
174
175# Static files (CSS, JavaScript, Images)
176# https://docs.djangoproject.com/en/2.0/howto/static-files/
177
178STATIC_URL = '/static/'
179
180MEDIA_ROOT = ''
181MEDIA_URL = '/media/'
Contact (issues, pull requests, etc.) at git@yingtongli.me. Generated by cgit.