python - CSRF verification error on GET form method -


i getting error csrf verification failed. request aborted. when trying submit form. have used method, yet getting error. have added {% csrf_token %} token also, sure, error still there.

sample html:

<body>     <form action="/entry/" method="get" name="form1"><br>         {% csrf_token %}         <select name="date" size="1">             <option>30</option>         </select>         &nbsp;         <select name="month">             <option>09</option>         </select>         <select name="year">             <option>2015</option>         </select>         <input id="save" style="height: 50px; width: 100px;" type="submit" value="save"></form> </body> 

views.py file

def getuser(request):     return render(request, 'index.html')  def putrecord(request):     date = request.get['date']     print date     month = request.get['month']     year = request.get['year']     time_stamp = date + '/' + month + '/' + year     print time_stamp     return render(request, 'index.html', {}) 

urls.py

urlpatterns = patterns('',      url(r'^expenseapp/', getuser),     url(r'^entry/', putrecord), ) 

i have csrfviewmiddleware in settings file. how can rid of error?

try delete cookies browser, csrf use cookie store token.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -