更新缓存功能

This commit is contained in:
曹前明 2022-06-21 14:20:21 +08:00
parent a435834a33
commit 10c067240f
2 changed files with 15 additions and 11 deletions

View File

@ -374,7 +374,7 @@ class UserViewSet(PageOrNot, ModelViewSet):
def daoru(self, request, pk=None):
from openpyxl import load_workbook
wb = load_workbook('./media/default/users.xlsx')
sheet = wb.get_sheet_by_name('Sheet1')
sheet = wb.get_sheet_by_name('Sheet2')
i = 3
role1 = Role.objects.get(name='能力查询')
role2 = Role.objects.get(name='资质能力报送')

View File

@ -186,16 +186,20 @@ AUTHENTICATION_BACKENDS = (
# 缓存配置
# CACHES = {
# "default": {
# "BACKEND": "django_redis.cache.RedisCache",
# "LOCATION": "redis://127.0.0.1:6379/9",
# "OPTIONS": {
# "CLIENT_CLASS": "django_redis.client.DefaultClient",
# # "PICKLE_VERSION": -1
# }
# }
# }
CACHES = {
# "default": {
# "BACKEND": "django_redis.cache.RedisCache",
# "LOCATION": "redis://127.0.0.1:6379/9",
# "OPTIONS": {
# "CLIENT_CLASS": "django_redis.client.DefaultClient",
# # "PICKLE_VERSION": -1
# }
# }
'default': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
'LOCATION': os.path.join(BASE_DIR, 'temp'),
}
}
# 日志配置
# 创建日志的路径
LOG_PATH = os.path.join(BASE_DIR, 'log')