Re: Django 1.3 CSRF faild when upgraded from Django 1.2.5

2011-05-11 Thread 阮明辉
I had try it , but it did't work . return render_to_response('account/login.html') these code is invoke when the http post method is 'get' but my problem is 'POST' I add django.contrib.csrf.middleware.CsrfResponseMiddleware to my settings and it can work but I think this is not the best solution 2

Re: Django 1.3 CSRF faild when upgraded from Django 1.2.5

2011-05-10 Thread _ johnny .
Try add RequestContext in render_to_response() from django.template import RequestContext return render_to_response('account/login.html', > locals(), context_instance=RequestContext(request)) On Tue, May 10, 2011 at 10:10 AM, 阮明辉 wrote: > return render_to_response('account/login.html') > --

Django 1.3 CSRF faild when upgraded from Django 1.2.5

2011-05-10 Thread 阮明辉
Hi, When I upgrade Djago from 1.2.5 some of my code failds. I am new to django, When I write a login form . there are some errors. I got a http403 CSRF verification failed. Request aborted. But I hava put 'django.middleware.csrf.CsrfViewMiddleware', on settings.py and {% csrf_token %} on my t