Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.

Commit 699206d

Browse files
committed
feat: change cache backend on DEBUG mode
1 parent 3fb31ed commit 699206d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

demo_proj/ncov/settings.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138

139139
CACHES = {
140140
'default': {
141-
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
141+
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
142142
'LOCATION': '/var/tmp/ncov_cache',
143143
'TIMEOUT': 3600,
144144
'OPTIONS': {
@@ -147,6 +147,9 @@
147147
}
148148
}
149149

150+
if DEBUG == False:
151+
CACHES['default']['BACKEND'] = 'django.core.cache.backends.filebased.FileBasedCache'
152+
150153
# 跨域增加忽略
151154
CORS_ALLOW_CREDENTIALS = True
152155
CORS_ORIGIN_ALLOW_ALL = True

0 commit comments

Comments
 (0)