mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-21 01:58:23 +02:00
Add Redis Channel Layer for the drawing system
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -79,6 +79,11 @@ if "test" not in sys.argv: # pragma: no cover
|
||||
'mailer',
|
||||
]
|
||||
|
||||
if os.getenv("TFJM_STAGE", "dev") == "prod": # pragma: no cover
|
||||
INSTALLED_APPS += [
|
||||
'channels_redis',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
@ -268,7 +273,6 @@ FORBIDDEN_TRIGRAMS = [
|
||||
"SEX",
|
||||
]
|
||||
|
||||
# TODO: Use a redis server in production
|
||||
CHANNEL_LAYERS = {
|
||||
"default": {
|
||||
"BACKEND": "channels.layers.InMemoryChannelLayer"
|
||||
|
@ -30,3 +30,12 @@ CSRF_COOKIE_SECURE = False
|
||||
CSRF_COOKIE_HTTPONLY = False
|
||||
X_FRAME_OPTIONS = 'DENY'
|
||||
SESSION_COOKIE_AGE = 60 * 60 * 3
|
||||
|
||||
CHANNEL_LAYERS = {
|
||||
"default": {
|
||||
"BACKEND": "channels_redis.core.RedisChannelLayer",
|
||||
"CONFIG": {
|
||||
"hosts": [(os.getenv('REDIS_SERVER_HOST', 'localhost'), os.getenv('REDIS_SERVER_PORT', 6379))],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user