From 922dc5ccb74d7a88ccfcc184c5719200e4c33646 Mon Sep 17 00:00:00 2001 From: Vitor Freitas Date: Tue, 7 Sep 2021 22:29:00 -0300 Subject: [PATCH] Upgrade pillow. Add sentry integration. --- parsifal/__init__.py | 2 +- parsifal/apps/core/context_processors.py | 7 ++++- parsifal/settings/base.py | 1 + parsifal/settings/production.py | 2 +- parsifal/templates/base.html | 35 ++++++++++++++++++------ parsifal/templates/includes/footer.html | 5 ++++ requirements/base.txt | 4 +-- 7 files changed, 42 insertions(+), 14 deletions(-) diff --git a/parsifal/__init__.py b/parsifal/__init__.py index 07823235..d0d0590e 100644 --- a/parsifal/__init__.py +++ b/parsifal/__init__.py @@ -1,5 +1,5 @@ from parsifal.utils.version import get_version -VERSION = (2, 0, 1, "final", 0) +VERSION = (2, 0, 2, "final", 0) __version__ = get_version(VERSION) diff --git a/parsifal/apps/core/context_processors.py b/parsifal/apps/core/context_processors.py index 8dba12ec..92eabe9c 100644 --- a/parsifal/apps/core/context_processors.py +++ b/parsifal/apps/core/context_processors.py @@ -1,10 +1,15 @@ from django.conf import settings as django_settings +import parsifal + def settings(request): return { - "environment": django_settings.PARSIFAL_ENVIRONMENT, + "parsifal_version": parsifal.__version__, + "parsifal_release": django_settings.PARSIFAL_RELEASE, + "parsifal_environment": django_settings.PARSIFAL_ENVIRONMENT, "recaptcha_enabled": django_settings.GOOGLE_RECAPTCHA_ENABLED, "recaptcha_site_key": django_settings.GOOGLE_RECAPTCHA_SITE_KEY, "google_analytics_ua": django_settings.GOOGLE_ANALYTICS_UA, + "sentry_dsn": django_settings.SENTRY_DSN, } diff --git a/parsifal/settings/base.py b/parsifal/settings/base.py index 56a3854f..71003bb5 100644 --- a/parsifal/settings/base.py +++ b/parsifal/settings/base.py @@ -199,6 +199,7 @@ GOOGLE_RECAPTCHA_SITE_KEY = config("GOOGLE_RECAPTCHA_SITE_KEY", default="") GOOGLE_RECAPTCHA_SECRET_KEY = config("GOOGLE_RECAPTCHA_SECRET_KEY", default="") +SENTRY_DSN = config("SENTRY_DSN", default="") # ============================================================================== # FIRST-PARTY APP diff --git a/parsifal/settings/production.py b/parsifal/settings/production.py index 570d3b1c..1ae18195 100644 --- a/parsifal/settings/production.py +++ b/parsifal/settings/production.py @@ -41,7 +41,7 @@ # ============================================================================== sentry_sdk.init( - dsn=config("SENTRY_DSN", default=""), + dsn=SENTRY_DSN, environment=PARSIFAL_ENVIRONMENT, release=PARSIFAL_RELEASE, integrations=[DjangoIntegration()], diff --git a/parsifal/templates/base.html b/parsifal/templates/base.html index 6a1349fe..49d1488e 100644 --- a/parsifal/templates/base.html +++ b/parsifal/templates/base.html @@ -40,16 +40,33 @@ {% endcompress %} {% block stylesheet %}{% endblock %} - {% if environment == "production" and google_analytics_ua %} - - - + + {% if parsifal_environment == "production" %} + {% if google_analytics_ua %} + + + + {% endif %} + + {% if sentry_dsn %} + + + + {% endif %} {% endif %} +
diff --git a/parsifal/templates/includes/footer.html b/parsifal/templates/includes/footer.html index 6ba91a15..71506a33 100644 --- a/parsifal/templates/includes/footer.html +++ b/parsifal/templates/includes/footer.html @@ -10,5 +10,10 @@
+
+
+ v{{ parsifal_version }} +
+
diff --git a/requirements/base.txt b/requirements/base.txt index 825ea8c0..b060d0d3 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,11 +1,11 @@ bleach==4.1.0 bibtexparser==1.2.0 -Django==3.2.6 +Django==3.2.7 django-compressor==2.4.1 django-crispy-forms==1.12.0 dj-database-url==0.5.0 requests==2.26.0 -Pillow==8.3.1 +Pillow==8.3.2 psycopg2-binary==2.9.1 python-decouple==3.4 python-docx==0.8.11