临时修改缓存机制,防止启动时卡在Performing system checks...

main
RogerWork 1 year ago
parent cca302e610
commit face1c8301
  1. 26
      myshop_back/settings.py

@ -184,24 +184,24 @@ REST_FRAMEWORK = {
CORS_ALLOW_CREDENTIALS = True # 跨域时是否携带cookie
CORS_ORIGIN_ALLOW_ALL = True # 指定所有域名都可以访问后端接口
# CACHES = {
# 'default': {
# 'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
# 'LOCATION': 'my_cache_table',
# }
# }
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://home.rogersun.cn:6379',
'OPTIONS': {
'CLIENT_CLASS': 'django_redis.client.DefaultClient',
'PASSWORD': 'Sxzgx1209',
}
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'my_cache_table',
}
}
# CACHES = {
# 'default': {
# 'BACKEND': 'django_redis.cache.RedisCache',
# 'LOCATION': 'redis://home.rogersun.cn:6379',
# 'OPTIONS': {
# 'CLIENT_CLASS': 'django_redis.client.DefaultClient',
# 'PASSWORD': 'Sxzgx1209',
# }
# }
# }
SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
SESSION_CACHE_ALIAS = 'default'

Loading…
Cancel
Save