On Sat, Feb 20, 2016 at 11:33 PM, Xristos Xristoou <saxr...@gmail.com> wrote:
> i find solution for that error > > if i change request to : > > if 'nums' in request.POST: > nums = request.POST['nums'] > else: > nums = False > > > > now i have else error and i think the code in my html form is wrong > (inside the form i copy paste {% csrf_token %}) and again nothing > > Forbidden (403) > > CSRF verification failed. Request aborted > Where did you place the {% csrf_token %} in your template? It needs to sit anywhere in between your <form></form> tags. If it is outside of the <form> tags, it will have no effect. You should also look at the source code of the page inside of the browser and make sure that is a hidden form element named csrf_token with a value of a random string, to ensure it is being generated properly. https://docs.djangoproject.com/en/1.9/ref/csrf/#how-to-use-it -James -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciU3bjyocBME100xLhDxY4r7FC5QxMWjoVqmZVj17RSzRg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.