Преглед изворни кода

Using HttpResponseRedirect after successful posting

David Leonard пре 10 година
родитељ
комит
c0d80c6986
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      hackathon_starter/hackathon/views.py

+ 1 - 1
hackathon_starter/hackathon/views.py

@@ -241,7 +241,7 @@ def twilio(request):
         message = request.POST.get('message')
         sendSMS(str(message), str(number), '+13473781813')
         context = {'message': 'Your message has been sent successfully!'}
-        return HttpResponse('Your message has been sent successfully')
+        return HttpResponseRedirect('/hackathon/api/')
     return render(request, 'hackathon/twilio.html')