File tree Expand file tree Collapse file tree 1 file changed +21
-11
lines changed
Expand file tree Collapse file tree 1 file changed +21
-11
lines changed Original file line number Diff line number Diff line change 2323
2424# CACHES
2525# ------------------------------------------------------------------------------
26- CACHES = {
27- "default" : {
28- "BACKEND" : "django_redis.cache.RedisCache" ,
29- "LOCATION" : env ("REDIS_URL" ),
30- "OPTIONS" : {
31- "CLIENT_CLASS" : "django_redis.client.DefaultClient" ,
32- # Mimicing memcache behavior.
33- # https://github.com/jazzband/django-redis#memcached-exceptions-behavior
34- "IGNORE_EXCEPTIONS" : True ,
35- },
26+ REDIS_URL = env ("REDIS_URL" , default = "" )
27+
28+ if REDIS_URL :
29+ CACHES = {
30+ "default" : {
31+ "BACKEND" : "django_redis.cache.RedisCache" ,
32+ "LOCATION" : REDIS_URL ,
33+ "OPTIONS" : {
34+ "CLIENT_CLASS" : "django_redis.client.DefaultClient" ,
35+ # Mimicing memcache behavior.
36+ # https://github.com/jazzband/django-redis#memcached-exceptions-behavior
37+ "IGNORE_EXCEPTIONS" : True ,
38+ },
39+ }
40+ }
41+ else :
42+ CACHES = {
43+ "default" : {
44+ "BACKEND" : "django.core.cache.backends.locmem.LocMemCache" ,
45+ "LOCATION" : "" ,
46+ }
3647 }
37- }
3848
3949# SECURITY
4050# ------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments