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 %} +