Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • Thanks for the answer. I tried POST method as well but in that I am getting some http error with status code "HTTP/1.0 403 FORBIDDEN" in the browser console. The line I added in urls.py is url(r'^ApplyCode/$', views.applycode, name='applycode'),. Am I missing something over here? Commented Nov 7, 2015 at 4:00
  • Probably, I got the solution. I need to add from django.views.decorators.csrf import csrf_exempt at top of my views.py and @csrf_exempt above the applycode() function to make it work. Thanks.! Commented Nov 7, 2015 at 4:12
  • Yes. See also this section of the documentation. Commented Nov 7, 2015 at 4:14
  • But I am wondering that now I am not getting any error in my browser console but not even the applycode() is functioning in anyway. I am not able to get any response from that function. Do I need to approach different method for the same? I am also refering the documentation given by you to find the solution..!! Commented Nov 7, 2015 at 5:01
  • @ParasBotadra you need to change if request.method=='GET': in your views to if request.method=='POST': Commented Nov 7, 2015 at 6:07