1👍
✅
If PlaySound
is not a method of a class, then you don’t need self
. use def PlaySound():
.
def PlaySound():
...
You can then call the method in the view, before you return the response.
def view(request):
PlaySound()
return render(request, "page.html")
Source:stackexchange.com