17
17
}
18
18
}
19
19
20
+ INSTALLED_APPS += ['minio_storage' ] # noqa F405
21
+
22
+ DEFAULT_FILE_STORAGE = "minio_storage.storage.MinioMediaStorage"
23
+ STATICFILES_STORAGE = "minio_storage.storage.MinioStaticStorage"
24
+ MINIO_STORAGE_ENDPOINT = f"{ env ('MINIO_SERVER' )} :9000"
25
+ MINIO_STORAGE_ACCESS_KEY = env ('MINIO_ACCESS_KEY' )
26
+ MINIO_STORAGE_SECRET_KEY = env ('MINIO_SECRET_KEY' )
27
+ MINIO_STORAGE_USE_HTTPS = False
28
+ MINIO_STORAGE_MEDIA_BUCKET_NAME = 'media'
29
+ MINIO_STORAGE_AUTO_CREATE_MEDIA_BUCKET = True
30
+ MINIO_STORAGE_STATIC_BUCKET_NAME = 'static'
31
+ MINIO_STORAGE_AUTO_CREATE_STATIC_BUCKET = True
32
+ MINIO_STORAGE_MEDIA_URL = "/media"
33
+ MINIO_STORAGE_STATIC_URL = "/static"
34
+
35
+ MINIO_STORAGE_AUTO_CREATE_STATIC_POLICY = True
36
+ MINIO_STORAGE_AUTO_CREATE_MEDIA_POLICY = True
37
+
20
38
# SECURITY
21
39
# ------------------------------------------------------------------------------
22
- # https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header
23
- SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO' , 'https' )
24
- # https://docs.djangoproject.com/en/dev/ref/settings/#secure-ssl-redirect
25
- SECURE_SSL_REDIRECT = env .bool ('DJANGO_SECURE_SSL_REDIRECT' , default = True )
40
+ # # https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header
41
+ # SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
42
+ # # https://docs.djangoproject.com/en/dev/ref/settings/#secure-ssl-redirect
43
+ # SECURE_SSL_REDIRECT = env.bool('DJANGO_SECURE_SSL_REDIRECT', default=True)
26
44
# https://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-secure
27
- SESSION_COOKIE_SECURE = True
28
- # https://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-httponly
29
- SESSION_COOKIE_HTTPONLY = True
30
- # https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-secure
31
- CSRF_COOKIE_SECURE = True
32
- # https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-httponly
33
- CSRF_COOKIE_HTTPONLY = True
34
- # https://docs.djangoproject.com/en/dev/topics/security/#ssl-https
35
- # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-seconds
36
- # TODO: set this to 60 seconds first and then to 518400 once you prove the former works
37
- SECURE_HSTS_SECONDS = 60
38
- # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-include-subdomains
39
- SECURE_HSTS_INCLUDE_SUBDOMAINS = env .bool ('DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS' , default = True )
40
- # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-preload
41
- SECURE_HSTS_PRELOAD = env .bool ('DJANGO_SECURE_HSTS_PRELOAD' , default = True )
42
- # https://docs.djangoproject.com/en/dev/ref/middleware/#x-content-type-options-nosniff
43
- SECURE_CONTENT_TYPE_NOSNIFF = env .bool ('DJANGO_SECURE_CONTENT_TYPE_NOSNIFF' , default = True )
44
- # https://docs.djangoproject.com/en/dev/ref/settings/#secure-browser-xss-filter
45
- SECURE_BROWSER_XSS_FILTER = True
46
- # https://docs.djangoproject.com/en/dev/ref/settings/#x-frame-options
47
- X_FRAME_OPTIONS = 'DENY'
48
-
49
-
45
+ # SESSION_COOKIE_SECURE = True
46
+ # # https://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-httponly
47
+ # SESSION_COOKIE_HTTPONLY = True
48
+ # # https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-secure
49
+ # CSRF_COOKIE_SECURE = True
50
+ # # https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-httponly
51
+ # CSRF_COOKIE_HTTPONLY = True
52
+ # # https://docs.djangoproject.com/en/dev/topics/security/#ssl-https
53
+ # # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-seconds
54
+ # # TODO: set this to 60 seconds first and then to 518400 once you prove the former works
55
+ # SECURE_HSTS_SECONDS = 60
56
+ # # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-include-subdomains
57
+ # SECURE_HSTS_INCLUDE_SUBDOMAINS = env.bool('DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS', default=True)
58
+ # # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-preload
59
+ # SECURE_HSTS_PRELOAD = env.bool('DJANGO_SECURE_HSTS_PRELOAD', default=True)
60
+ # # https://docs.djangoproject.com/en/dev/ref/middleware/#x-content-type-options-nosniff
61
+ # SECURE_CONTENT_TYPE_NOSNIFF = env.bool('DJANGO_SECURE_CONTENT_TYPE_NOSNIFF', default=True)
62
+ # # https://docs.djangoproject.com/en/dev/ref/settings/#secure-browser-xss-filter
63
+ # SECURE_BROWSER_XSS_FILTER = True
64
+ # # https://docs.djangoproject.com/en/dev/ref/settings/#x-frame-options
65
+ # X_FRAME_OPTIONS = 'DENY'
66
+
67
+ SECRET_KEY = env ('DJANGO_SECRET_KEY' )
68
+
69
+ #TODO: change this to the hostname that you want to listen on
70
+ ALLOWED_HOSTS = "*"
50
71
51
72
# TEMPLATES
52
73
# ------------------------------------------------------------------------------
65
86
# ------------------------------------------------------------------------------
66
87
# https://docs.djangoproject.com/en/dev/ref/settings/#server-email
67
88
# https://docs.djangoproject.com/en/dev/ref/settings/#email-subject-prefix
68
- EMAIL_SUBJECT_PREFIX = env ('DJANGO_EMAIL_SUBJECT_PREFIX' , default = '[AberCompSoc]' )
69
-
70
- MAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
71
-
72
- EMAIL_HOST = env ('DJANGO_SMTP_HOSTNAME' , default = 'smtp.office365.com' )
73
- EMAIL_PORT = env ('DJANGO_SMTP_POST' , default = 587 )
74
- EMAIL_HOST_USER = env ('DJANGO_SMTP_USER' )
75
- EMAIL_HOST_PASSWORD = env ('DJANGO_SMTP_PASSWORD' )
76
-
77
- EMAIL_USE_TLS = True
78
-
79
-
80
- # https://docs.djangoproject.com/en/dev/ref/settings/#default-from-email
81
- DEFAULT_FROM_EMAIL = env (
82
- 'DJANGO_DEFAULT_FROM_EMAIL' ,
83
- default = EMAIL_HOST_USER
84
- )
85
-
86
- SERVER_EMAIL = env ('DJANGO_SERVER_EMAIL' , default = DEFAULT_FROM_EMAIL )
89
+ MAIL_BACKEND = 'django.core.mail.backends.console'
87
90
88
91
# Static Files
89
92
#
143
146
144
147
# Your stuff...
145
148
# ------------------------------------------------------------------------------
149
+
150
+ CHANNEL_LAYERS = {
151
+ "default" : {
152
+ "BACKEND" : "channels_redis.core.RedisChannelLayer" ,
153
+ "CONFIG" : {
154
+ "hosts" : [(env ("REDIS_HOST" ), 6379 )],
155
+ },
156
+ },
157
+ }
158
+
159
+ JUDGE0_ENDPOINT = "http://judgezero:3000"
0 commit comments