From 40a710f41e0a5e6579296e1ab275c2b0bffd1bd8 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sat, 11 Feb 2023 14:03:50 +0000 Subject: [PATCH] Add caching --- app/settings.py | 14 + core/templates/base.html | 596 ++++++++++++++++++++------------------- requirements.txt | 3 + 3 files changed, 317 insertions(+), 296 deletions(-) diff --git a/app/settings.py b/app/settings.py index b78c03f..d8dd5db 100644 --- a/app/settings.py +++ b/app/settings.py @@ -45,6 +45,20 @@ INSTALLED_APPS = [ "prettyjson", "mixins", ] + +# Performance optimisations +CACHES = { + "default": { + "BACKEND": "django.core.cache.backends.redis.RedisCache", + "LOCATION": "unix:///var/run/socks/redis.sock", + "OPTIONS": { + "db": "10", + "parser_class": "redis.connection.PythonParser", + "pool_class": "redis.BlockingConnectionPool", + }, + } +} + CRISPY_TEMPLATE_PACK = "bulma" CRISPY_ALLOWED_TEMPLATE_PACKS = ("bulma",) DJANGO_TABLES2_TEMPLATE = "django-tables2/bulma.html" diff --git a/core/templates/base.html b/core/templates/base.html index 83e6282..f95a5d1 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,339 +1,343 @@ {% load static %} {% load has_plan %} +{% load cache %} - - - - Pathogen - {{ request.path_info }} - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - {# Yes it's in the source, fight me #} - - + .grid-stack-item-content { + display: flex !important; + flex-direction: column !important; + overflow-x: hidden !important; + overflow-y: hidden !important; + } - + .panel { + display: flex !important; + flex-direction: column !important; + overflow: hidden; + } + + .panel-block { + overflow-y:auto; + overflow-x:auto; + min-height: 90%; + display: block; + } + + .floating-window { + /* background-color:rgba(210, 210, 210, 0.6) !important; */ + display: flex !important; + flex-direction: column !important; + overflow-x: hidden !important; + overflow-y: hidden !important; + max-height: 300px; + z-index: 9000; + position: absolute; + top: 50px; + left: 50px; + } + + .floating-window .panel { + background-color:rgba(250, 250, 250, 0.8) !important; + } + + .float-right { + float: right; + padding-right: 5px; + padding-left: 5px; + } + .grid-stack-item:hover .ui-resizable-handle { + display: block !important; + } + .ui-resizable-handle { + z-index: 39 !important; + } + + .small-field { + overflow: hidden; + text-overflow: ellipsis; + overflow-y: hidden; + } + + + {# Yes it's in the source, fight me #} + + + + + {% endcache %} - - + {% endcache %}