From 566af94dd83c9b3665de3672fcd8dd71bb0361b3 Mon Sep 17 00:00:00 2001 From: Victor Fabre Date: Wed, 11 Apr 2018 12:49:30 -0300 Subject: [PATCH] Fix #1836 (#1837) --- requirements/requirements.txt | 1 + sapl/settings.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 4e8c9e452..2f6b5a8db 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -35,3 +35,4 @@ gunicorn==19.6.0 django-reversion==2.0.8 WeasyPrint==0.42 whoosh==2.7.4 +git+git://github.com/interlegis/django-speedinfo.git diff --git a/sapl/settings.py b/sapl/settings.py index 2e6b7c7ff..e79df2d61 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -87,6 +87,7 @@ INSTALLED_APPS = ( 'rest_framework', 'reversion', 'whoosh', + 'speedinfo', ) + SAPL_APPS @@ -125,8 +126,16 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', + 'speedinfo.middleware.ProfilerMiddleware', ) +CACHES = { + 'default': { + 'BACKEND': 'speedinfo.backends.proxy_cache', + 'CACHE_BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', + 'LOCATION': '/var/tmp/django_cache', + } +} REST_FRAMEWORK = { "UNICODE_JSON": False,