diff --git a/Pipfile b/Pipfile index ff69e9b..b360aeb 100644 --- a/Pipfile +++ b/Pipfile @@ -11,6 +11,7 @@ pydotplus = "*" [packages] django = "*" +django-cacheops = "*" [requires] python_version = "3.8" diff --git a/bak b/bak new file mode 100644 index 0000000..2bdfb79 --- /dev/null +++ b/bak @@ -0,0 +1,6 @@ + + {% if coin.name %} +

{{ coin.found_on|date:"d.m.Y" }}: {{ coin.value|floatformat:2 }} € von {{ coin.year }} "{{ coin.name }}" aus {{ coin.country}} von {{ coin.found_by }}

+ {⅝ else %} +

{{ coin.found_on|date:"d.m.Y" }}: {{ coin.value|floatformat:2 }} € von {{ coin.year }} aus {{ coin.country}} von {{ coin.found_by }}

+ {% endif %} diff --git a/coinmanager/coinc/models.py b/coinmanager/coinc/models.py index fd7bfeb..de2a194 100644 --- a/coinmanager/coinc/models.py +++ b/coinmanager/coinc/models.py @@ -49,7 +49,7 @@ class Country(Model): def __str__(self): - return f"{self.name} {self.name_iso} {self.comment}" + return f"{self.name}" diff --git a/coinmanager/coinc/templates/coinc/index.html b/coinmanager/coinc/templates/coinc/index.html index 16654cb..61b4ac7 100644 --- a/coinmanager/coinc/templates/coinc/index.html +++ b/coinmanager/coinc/templates/coinc/index.html @@ -2,9 +2,9 @@ {% if countrys %}

Gesamtwert {{ coin_sum }}

{% include 'coinc/filter_country.html' with countrys=countrys %} -

Zuletzt hinzugefügt

- {% for coin in recent_coins %} -

{{ coin.found_on|date:"d.m.Y" }}: {{ coin.value|floatformat:2 }} € {{ coin.name }} von {{ coin.found_by }}

+

Zuletzt gefunden

+ {⅝ for coin in recent_coins %} +

{{ coin.found_on|date:"d.m.Y" }}: {{ coin.value|floatformat:2 }} € von {{ coin.year }} aus {{ coin.country}} von {{ coin.found_by }}

{% endfor %} {% else %}

Trage zuerst Länder im Adminbereich ein.

{% endif %} diff --git a/coinmanager/coinc/templates/footer.html b/coinmanager/coinc/templates/footer.html index 825fc56..ff9bee1 100644 --- a/coinmanager/coinc/templates/footer.html +++ b/coinmanager/coinc/templates/footer.html @@ -1,3 +1,3 @@ - Version 210705 + Version 210712 diff --git a/coinmanager/coinmanager/production_settings.py b/coinmanager/coinmanager/production_settings.py index 2eac413..be88c2a 100644 --- a/coinmanager/coinmanager/production_settings.py +++ b/coinmanager/coinmanager/production_settings.py @@ -32,6 +32,7 @@ ALLOWED_HOSTS = ['willipink.eu'] INSTALLED_APPS = [ 'coinc.apps.CoincConfig', + 'cacheops', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', @@ -149,6 +150,7 @@ CACHES = { # caching # CACHE_MIDDLEWARE_ALIAS = 'default' -CACHE_MIDDLEWARE_SECONDS = 60*60*24*365 +# CACHE_MIDDLEWARE_SECONDS = 60*60*24*365 CACHEOPS_REDIS = "unix://var/run/redis/redis-server.sock" +CACHEOPS_DEGRADE_ON_FAILURE = True diff --git a/coinmanager/db.sqlite3 b/coinmanager/db.sqlite3 index 97f7249..a117640 100755 Binary files a/coinmanager/db.sqlite3 and b/coinmanager/db.sqlite3 differ diff --git a/update b/update index f9f95f3..a83efb3 100755 --- a/update +++ b/update @@ -18,14 +18,14 @@ git pull -q origin master >/dev/null echo -n "... bumping " version=$(date +"%y%m%d") -sed -i "s/[0-9]\{6\}/$version/g" coinc/templates/footer.html >/dev/null +sed -i "s/[0-9]\{6\}/$version/g" coinc/templates/footer.html echo -n "... collecting " -python3 manage.py collectstatic --settings coinmanager.production_settings --no-input >/dev/null +python3 manage.py collectstatic --settings coinmanager.production_settings --no-input echo -n "... owning " sudo chmod 775 db.sqlite3 -sudo chown -R $user:$web_user $path >/dev/null +sudo chown -R $user:$web_user $path echo "... reloading " -sudo systemctl restart apache2 >/dev/null +sudo systemctl restart apache2