workinblox

This commit is contained in:
trav 2021-04-15 10:51:02 -04:00
parent 7361aeb4a9
commit b49f59e7b6

View File

@ -5,12 +5,13 @@ from django.views.decorators.http import require_GET, require_POST
from django.shortcuts import render, get_object_or_404 from django.shortcuts import render, get_object_or_404
from webpush import send_user_notification from webpush import send_user_notification
from django.conf import settings from django.conf import settings
from djangoldp_webpushnotification import models
import json import json
@require_GET @require_GET
def home(request): def home(request):
webpush_settings = getattr(settings, 'WEBPUSH_SETTINGS', {}) webpush_settings = getattr(settings, 'WEBPUSH_SETTINGS', {})
vapid_key = webpush_settings.get('VAPID_PUBLIC_KEY') vapid_key = models.VAPIDKeyset.objects.first().public_key.decode("utf-8")
user = request.user user = request.user
return render(request, 'home.html', {user: user, 'vapid_key': vapid_key}) return render(request, 'home.html', {user: user, 'vapid_key': vapid_key})