workinblox

This commit is contained in:
trav 2021-04-15 10:51:02 -04:00
parent 7361aeb4a9
commit b49f59e7b6
1 changed files with 2 additions and 1 deletions

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 webpush import send_user_notification
from django.conf import settings
from djangoldp_webpushnotification import models
import json
@require_GET
def home(request):
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
return render(request, 'home.html', {user: user, 'vapid_key': vapid_key})