a lot of changes
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
CACHES = {
|
||||
"default": {
|
||||
"BACKEND": 'django_redis.cache.RedisCache',
|
||||
"LOCATION": 'redis://127.0.0.1:6379/1',
|
||||
"TIMEOUT": 5,
|
||||
"LOCATION": 'redis://redis:6379',
|
||||
"TIMEOUT": 300,
|
||||
},
|
||||
}
|
||||
|
||||
CACHE_MIDDLEWARE_SECONDS = 5
|
||||
CACHE_MIDDLEWARE_SECONDS = 300
|
||||
|
||||
|
||||
CACHEOPS_REDIS = 'redis://127.0.0.1:6379/1'
|
||||
CACHEOPS_REDIS = 'redis://redis:6379'
|
||||
CACHEOPS_DEFAULTS = {
|
||||
"timeout": 5,
|
||||
"timeout": 300,
|
||||
}
|
||||
|
||||
CACHEOPS = {
|
||||
@@ -23,6 +23,10 @@ CACHEOPS = {
|
||||
"ops": "all",
|
||||
"timeout": 60 * 5
|
||||
},
|
||||
"company.Company":{
|
||||
"ops": "all",
|
||||
"timeout": 300,
|
||||
},
|
||||
"products.*": {
|
||||
"ops": "all",
|
||||
"timeout": 60 * 5
|
||||
@@ -42,4 +46,4 @@ CACHEOPS = {
|
||||
|
||||
}
|
||||
CACHEOPS_DEGRADE_ON_FAILURE = True
|
||||
CACHEOPS_ENABLED = False
|
||||
CACHEOPS_ENABLED = True
|
||||
@@ -35,6 +35,8 @@ PACKAGES = [
|
||||
'rest_framework',
|
||||
'rest_framework_simplejwt',
|
||||
'corsheaders',
|
||||
'cacheops',
|
||||
# 'silk',
|
||||
]
|
||||
|
||||
DJANGO_APPS = [
|
||||
@@ -62,6 +64,7 @@ MIDDLEWARE = [
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
# 'silk.middleware.SilkyMiddleware',
|
||||
]
|
||||
|
||||
ROOT_URLCONF = 'config.urls'
|
||||
|
||||
@@ -33,3 +33,4 @@ urlpatterns = [
|
||||
# Media and Static Files
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
||||
urlpatterns += [path('silk/', include('silk.urls', namespace='silk'))]
|
||||
|
||||
Reference in New Issue
Block a user