Friday, August 29, 2014

how to call django web page with ordinary html page

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, url
        from django.contrib import admin
        from login import views
              urlpatterns = 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 me 

Thnx 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.

No comments:

Post a Comment