You are missing csrf_token which is set by request for csrf verification. After the line
<form action="http://127.0.0.1:8000/test/" method="post">
in your code put {%csrf_token%} and it should work fine and also read why it didnot worked without it from https://docs.djangoproject.com/en/dev/ref/contrib/csrf/ . This should answer all your queries.<form action="http://127.0.0.1:8000/test/" method="post">
On Fri, Aug 29, 2014 at 4:36 PM, Pawan Soni <pawan.soni410@gmail.com> wrote:
Hi ,--i have a simple html page,p.html which is not made in django application ,its just a ordinary html page which look like..<html><body><form action="http://127.0.0.1:8000/test/" method="post"><input type="text" value="test" name="payemnt_ref"><input type="submit"></body><html>In form's action i am passing the path of my django url..this is my urls.py file..from django.conf.urls import patterns, include, urlfrom django.contrib import admin
from login import viewsurlpatterns = patterns('',url(r'^test',views.paymentcheck_view,name="test"),)my views.py..def paymentcheck_view(request):if request.method == "POST":c = {}c.update(csrf(request))return render_to_response('login1/create_pay_page.html',c)else:return HttpResponse('GET')Error i got ...Forbidden (403)
CSRF verification failed. Request aborted.
........i am stuck over here,pls help meThnx in advance
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2b21261b-c48f-43d2-8db0-810b0c7a9c02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOdEGu3AxhqBMaHBsfw8-qb5RvHj0ATt3CPtoptBDyubQUJW-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment