Here's my scenario: User adds something to the shopping cart, and if the python view handling this logic does it successfully, it should fire off a JavaScript function saying 'You've added a product into your cart!'.
How would one go about doing that?
Here's what I tried so far:
return HttpResponse("alert('hello world');", mimetype="application/x-javascript")
but this just outputs the code as a string.
To be specific: I need to fire a function in a JS file.