File tree Expand file tree Collapse file tree 3 files changed +18
-9
lines changed Expand file tree Collapse file tree 3 files changed +18
-9
lines changed Original file line number Diff line number Diff line change 84
84
USE_TZ = (bool ,True ),
85
85
TIME_ZONE = (str ,'Canada/Pacific' ),
86
86
87
- # Database defaults:
87
+ # SQL defaults
88
88
SQL_HOST = (str , 'db' ),
89
- SQL_DATABASE = (str , 'ubyssey' ),
89
+ SQL_DATABASE = (str , 'ubyssey' ),
90
90
SQL_USER = (str , 'root' ),
91
91
SQL_PASSWORD = (str , 'ubyssey' ),
92
92
93
+ # Redis defaults
94
+ REDIS_HOST = (str , '127.0.0.1' ),
95
+ REDIS_PORT = (str , '6379' ),
96
+
93
97
# Keys
94
98
SECRET_KEY = (str , 'thisisakey' ),
95
99
NOTIFICATION_KEY = (str , 'thisisakeytoo' ),
115
119
ADS_TXT_URL = env ('ADS_TXT_URL' )
116
120
ROOT_URLCONF = env ('ROOT_URLCONF' )
117
121
122
+ REDIS_HOST = env ('REDIS_HOST' )
123
+ REDIS_PORT = env ('REDIS_PORT' )
124
+
118
125
# Initialize the databases.
119
126
# Note it should be possible to parse all this information in a single line:
120
127
# DATABASES = {'default': env.db('DATABASE_URL')}
Original file line number Diff line number Diff line change 6
6
7
7
import environ
8
8
9
- env = environ .Env () #Scope issues without this line?
9
+ env = environ .Env () # Scope issues without this line?
10
10
11
11
BASE_URL = 'https://www.ubyssey.ca/'
12
12
13
13
ALLOWED_HOSTS = ['localhost' , '*' ]
14
14
15
15
INTERNAL_IPS = ['127.0.0.1' , '0.0.0.0' , 'localhost' ]
16
16
17
- INSTALLED_APPS += [
18
- ]
17
+ INSTALLED_APPS += []
19
18
20
19
# Sessions are used to anonymously keep track of individual site visitors
21
20
SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
22
21
23
- # TODO: replace these cache backends with a persistent solution like Memcached or Redis.
24
- # For now, use the default local memory cache.
25
22
CACHES = {
26
23
"default" : {
27
- "BACKEND" : "django.core.cache.backends.locmem.LocMemCache" ,
24
+ "BACKEND" : "django_redis.cache.RedisCache" ,
25
+ "LOCATION" : "redis://%s:%s" % (REDIS_HOST , REDIS_PORT ),
28
26
},
29
27
# The "renditions" cache is for Wagtail image renditions.
30
28
# Ref: https://docs.wagtail.org/en/v2.10.2/advanced_topics/performance.html#caching-image-renditions
31
29
"renditions" : {
32
- "BACKEND" : "django.core.cache.backends.locmem.LocMemCache" ,
30
+ "BACKEND" : "django_redis.cache.RedisCache" ,
31
+ "LOCATION" : "redis://%s:%s" % (REDIS_HOST , REDIS_PORT ),
33
32
}
34
33
}
35
34
Original file line number Diff line number Diff line change @@ -27,3 +27,6 @@ wagtailmenus==3.0.2
27
27
wagtail-cache==1.0.2
28
28
google-crc32c==1.3.0
29
29
wagtail-color-panel==1.4.0
30
+ django-redis==5.4.0
31
+ redis==5.0.1
32
+ hiredis==2.2.3
You can’t perform that action at this time.
0 commit comments