Я получаю сообщение об ошибке CSRF verification failed. Request aborted.
при попытке отправить форму. Я использовал метод GET, но получаю сообщение об ошибке. Я также добавил токен {% csrf_token %}, просто чтобы быть уверенным, но ошибка все еще существует.
Пример HTML:
<body>
<form action="/entry/" method="get" name="Form1"><br>
{% csrf_token %}
<select name="Date" size="1">
<option>30</option>
</select>
<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
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),
)
У меня также есть CsrfViewMiddleware
в моем файле настроек. Как я могу избавиться от этой ошибки?