You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
679 B
26 lines
679 B
from django.shortcuts import render
|
|
from django.http import HttpResponse, JsonResponse
|
|
from django.views.decorators.csrf import csrf_exempt
|
|
from .models import ASSNotification
|
|
import json
|
|
|
|
def index(request):
|
|
return HttpResponse("Hello, world. You're at the subs index.")
|
|
|
|
def test(request):
|
|
return HttpResponse("Test succeeded!")
|
|
|
|
@csrf_exempt
|
|
def app_store_webhook(request):
|
|
|
|
data = request.body.decode('utf-8')
|
|
# Parse the JSON payload
|
|
fulljson = json.loads(data)
|
|
signedPayload = fulljson['signedPayload']
|
|
|
|
notification = ASSNotification(
|
|
content=signedPayload,
|
|
)
|
|
notification.save()
|
|
|
|
return JsonResponse({'status': 'success'})
|
|
|