views.py 294 B

123456789101112
  1. from django.http import HttpResponse
  2. from anyjson import dumps
  3. def multiply(request):
  4. x = int(request.GET['x'])
  5. y = int(request.GET['y'])
  6. retval = x * y
  7. response = {'status': 'success', 'retval': retval}
  8. return HttpResponse(dumps(response), mimetype='application/json')