Also add js sentry stuff.

parent 4a00d42c
......@@ -2,6 +2,11 @@
// https://hackernoon.com/angular-vs-react-the-deal-breaker-7d76c04496bc
// also: reacts patent clause and mandatory jsx syntax ... NO
// Registry Sentry for error reporting
let sentry_token = document.head.querySelector("[name=sentry_token]").getAttribute('content');
if (sentry_token){
Raven.config(sentry_token).install();
}
// support for week numbers in javascript
// https://stackoverflow.com/questions/7765767/show-week-number-with-javascript
......
This diff is collapsed.
......@@ -7,6 +7,7 @@
<meta name="theme-color" content="Tomato"/>
<!-- export variables to javascript from server configuration -->
<meta name="mailto" content="{{mailto}}">
<meta name="sentry_token" content="{{sentry_token}}">
<title>{% trans "Site Title" %}</title>
<link rel="shortcut icon" type="image/png" href="{% static 'favicon.ico' %}"/>
......@@ -25,6 +26,7 @@
<script type="text/javascript" src="{% static 'js/leaflet-src.js' %}"></script>
<script type="text/javascript" src="{% static 'js/Leaflet.fullscreen.js' %}"></script>
<script type="text/javascript" src="{% static 'js/lazyload-custom.js' %}"></script>
<script type="text/javascript" src="{% static 'js/vendor/raven.min.vue.3.19.1.js' %}"></script>
<script type="text/javascript" src="{% static 'js/script.js' %}"></script>
{% else %}{% compress js %}
<script type="text/javascript" src="{% static 'js/vue.min.js' %}"></script>
......@@ -33,6 +35,7 @@
<script type="text/javascript" src="{% static 'js/leaflet.js' %}"></script>
<script type="text/javascript" src="{% static 'js/Leaflet.fullscreen.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/lazyload-custom.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/vendor/raven.min.vue.3.19.1.js' %}"></script>
<script type="text/javascript" src="{% static 'js/script.js' %}"></script>
{% endcompress %}{% endif %}
<link rel="manifest" href="/manifest.json">
......
......@@ -38,6 +38,7 @@ def index(request):
'version': __version__,
'admin': settings.ADMIN,
'mailto': settings.MAILTO,
'sentry_token': settings.SENTRY_TOKEN,
})
......
......@@ -476,9 +476,13 @@ ADMIN = bool(APPNAME == 'failmap-admin')
# general email address
MAILTO = 'info@faalkaart.nl'
# if sentry DSN is provided register raven to emit events on exceptions
if os.environ.get('SENTRY_DSN'):
INSTALLED_APPS += ('raven.contrib.django.raven_compat',)
RAVEN_CONFIG = {
'dsn': os.environ.get('SENTRY_DSN'),
'release': __version__,
}
# set javascript sentry token if provided
SENTRY_TOKEN = os.environ.get('SENTRY_TOKEN', 'https://a4f72b82fc0742bc82b82560b340006b@sentry.io/242170')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment