From fa3e2853304f02b7e4e50ae9c3ef3326329553c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20M=C3=BCnch?= Date: Mon, 12 Jul 2021 09:13:57 +0000 Subject: [PATCH] #48 still not working completely --- Pipfile | 1 + bak | 6 ++++++ coinmanager/coinc/models.py | 2 +- coinmanager/coinc/templates/coinc/index.html | 6 +++--- coinmanager/coinc/templates/footer.html | 2 +- .../coinmanager/production_settings.py | 4 +++- coinmanager/db.sqlite3 | Bin 1314816 -> 1314816 bytes update | 8 ++++---- 8 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 bak 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 97f724974fd31b976c4662da3086aafee501a8bd..a1176408f6d88b9fe40da3efc16794336b2c06c7 100755 GIT binary patch delta 5141 zcmbVQ33wD$wyyQoUN=j#gtZewKr~HNclGKr2_bADkN`=*K_E*f=}u?gAnGK-Ja8Tg zS%ezgCTt>%2pXhh<~gh`I4Jl8q}H&bj|R=iGB{ z-FsU)vsyZ{TKh};F$_<|FsuNzVB2svzW=2;U)u0B9TP{^;7MKEN2V)-Bp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XD7%EY7fn}-a(>=$!dk370x8O1!^nAn@KbkYPIrU5`CCA zCynSbX~c0gs#ZP8zhO}C9dv-BSpmYTU-v|b2rqz^JogrRI@>#YW-!n4hl=w8#rcJ^@{9bz zyaMsq5%#i*`17nlpg0gL4hClx6%^*pE^Hn-!sN&iBPRkj3f*tsXQ_cy;oJB<{0O>< zV(16(D%=jk;7ia3LfVM7QN55ksH!zXBo~^MvL#@y#mePkS%F!J&s4R##XpymG?ANQ zhVYr{R+nhK&eFxcfEkiY3e5Kz(1aswmYcQE1l^zpU~R7|SuXd6%^w4?5gA?_2(7Fa zuU%jT#+gMeKS|MmD;o-M)0m(luu(KTY!=DG51D(Yc(KfwAT}47#fqw>TBtjkCJN># z_wJ>^@*#(Ipl0|PBTxL zjlya&A5}kw#qvax*=3;WE%(~Tm?)ZVxpdL6)+|J4tG9?_^)8Qy-Ef)BS2o$^ROV9V zR>qYjDNB}DHl<8@0W@~%o;hy(eRL7EphEa(*bHZhMgEk`o>QKa2sDT$;Hi|`uxItx vG#l5c);bMuSdBdmqv}0b;@W<5f_xQw?=j)8qvFsl&tx2&84QTPm?!ifZTdW_ 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