Skip to content

Instantly share code, notes, and snippets.

@DanyF-github
Created March 24, 2022 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanyF-github/ff63349263efaf8b058edad14eb764f4 to your computer and use it in GitHub Desktop.
Save DanyF-github/ff63349263efaf8b058edad14eb764f4 to your computer and use it in GitHub Desktop.
@require_POST
@csrf_exempt
def status(request):
body = json.loads(request.body)
with open('status.txt', 'w') as status_file:
json.dump(body, status_file)
return HttpResponse(status=204)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment