文件缓存
This commit is contained in:
parent
2f94b76af7
commit
4e95f5e7d4
|
@ -52,7 +52,7 @@ class PTaskSerializer(serializers.ModelSerializer):
|
|||
|
||||
class FileSimpleSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model =File
|
||||
model = File
|
||||
fields = ['id', 'name', 'file', 'path']
|
||||
|
||||
class FileSerializer(serializers.ModelSerializer):
|
||||
|
|
|
@ -16,3 +16,4 @@ workalendar==16.2.0
|
|||
face_recognition==1.3.0
|
||||
gunicorn==20.1.0
|
||||
redis==4.1.4
|
||||
django-redis==5.2.0
|
||||
|
|
|
@ -195,16 +195,19 @@ AUTHENTICATION_BACKENDS = (
|
|||
)
|
||||
|
||||
# 缓存配置,有需要可更改为redis
|
||||
# CACHES = {
|
||||
# "default": {
|
||||
# "BACKEND": "django_redis.cache.RedisCache",
|
||||
# "LOCATION": "redis://127.0.0.1:6379/0",
|
||||
# "OPTIONS": {
|
||||
# "CLIENT_CLASS": "django_redis.client.DefaultClient",
|
||||
# "PICKLE_VERSION": -1
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
CACHES = {
|
||||
# "default": {
|
||||
# "BACKEND": "django_redis.cache.RedisCache",
|
||||
# "LOCATION": "redis://127.0.0.1:6379/0",
|
||||
# "OPTIONS": {
|
||||
# "CLIENT_CLASS": "django_redis.client.DefaultClient",
|
||||
# }
|
||||
# }
|
||||
'default': {
|
||||
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
|
||||
'LOCATION': os.path.join(BASE_DIR, 'temp'),
|
||||
}
|
||||
}
|
||||
|
||||
# celery配置,celery正常运行必须安装redis
|
||||
CELERY_BROKER_URL = "redis://127.0.0.1:6379/1" # 任务存储
|
||||
|
|
Loading…
Reference in New Issue