Re: CSRF verification failed, 'CSRF token missing or incorrect'

2020-08-10 Thread Shaurya Pratap Singh
> > It should be like this-> > {% csrf_token %} {{ form.as_p }} {% for field, errors in form.errors.items %} {{ errors }} {% endfor %} -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: CSRF verification failed, 'CSRF token missing or incorrect'

2020-06-28 Thread maninder singh Kumar
You need to pass RequestContext in render_to_response for csrf_token Maninder Kumar about.me/maninder.s.kumar

Re: CSRF verification failed, 'CSRF token missing or incorrect'

2020-06-28 Thread Akinfolarin Stephen
can i see the error log On Mon, Jun 29, 2020 at 7:06 AM Shinster wrote: > When I try to submit a Django form with username and password, I get this > error message: > 'CSRF token missing or incorrect'. > > The CSRF token is not missing at least. > Here is where I included it in my form in my .h

Re: CSRF verification failed when I use smart phone

2019-06-26 Thread Anirudh Jain
Are you using it as a website or mobile app? If it is website then try logging out and login again. You might have logged in as another user or it might be a caching problem. On Wed, 26 Jun 2019, 08:31 Aldian Fazrihady, wrote: > Please make sure csrftoken cookie is returned to the Android app >

Re: CSRF verification failed when I use smart phone

2019-06-25 Thread Aldian Fazrihady
Please make sure csrftoken cookie is returned to the Android app Regards, Aldian Fazrihady On Wed, 26 Jun 2019, 09:46 Robert F., wrote: > Make sure you aren't blocking cookies on whatever device is giving you > problems. You'll get this error if you are blocking them. > > On Tuesday, January

Re: CSRF verification failed when I use smart phone

2019-06-25 Thread Robert F.
Make sure you aren't blocking cookies on whatever device is giving you problems. You'll get this error if you are blocking them. On Tuesday, January 6, 2015 at 1:09:46 AM UTC-8, Sugita Shinsuke wrote: > > Hello. > > When I use Django via my smart phone Android and iOS. > The error sometimes occu

Re: csrf verification failed when trying to upload profile pic after login...please help

2017-04-05 Thread Kriti Rohilla
Csrf verification is used for cross site request forgery protection. In earlier versions of django csrf_token was needed to be imported in views.py file. In latest releases, however, ( I am using django 1.10), no such thing is required. All you need to do is include {% csrf_token %} in your templat

Re: CSRF verification failed when I use smart phone

2015-06-26 Thread Michael Greer
BTW, it turned out to be a cookie parsing error in python for us, only recently solved, in which Python incorrectly balked at parsing the "[" character in cookie values and then threw out the remaining cookies. This has been fixed in 2.7.10 (and new versions of 3) but is not yet in Debian stable.

Re: CSRF verification failed when I use smart phone

2015-06-26 Thread Wim Feijen
Thanks Gergely, That solved it for me. Wim On Sunday, 31 May 2015 09:58:32 UTC+2, Gergely Polonkai wrote: > > I had this error when I had two Django application with the same domain > and both with the same (default) CSRF cookie name. Changing the cookie name > to something different solved

Re: CSRF verification failed when I use smart phone

2015-05-31 Thread Gergely Polonkai
I had this error when I had two Django application with the same domain and both with the same (default) CSRF cookie name. Changing the cookie name to something different solved the issue. On 30 May 2015 22:30, "Michael Greer" wrote: > We have started seeing this behavior occasionally. No code ch

Re: CSRF verification failed when I use smart phone

2015-05-30 Thread Michael Greer
We have started seeing this behavior occasionally. No code change in this area, but sometimes (esp on phones) the CSRF cookie is wrong. Our guess is too many cookies on the domain, but it is difficult to prove this. Indeed, opening a new browser session resolves it... temporarily. -Mike On Tue

Re: CSRF verification failed when I use smart phone

2015-01-30 Thread Zach Borboa
Here's an example of the csrf cookie value obtained by typing document.cookie in the javascript console. -- You received this message because you are s

Re: CSRF verification failed when I use smart phone

2015-01-30 Thread Zach Borboa
What you want to compare is the expected token value and the token value the view received (via POST, PUT, DELETE, etc.). These values need to match. Printing out the token via {{ csrf_token }} in the template will show you the token that the view will receive when the form is submitted. This s

Re: CSRF verification failed when I use smart phone

2015-01-30 Thread Pouria M
Thanks Zach. What are your thoughts after this test? if they match or if they don't match On Wednesday, January 28, 2015 at 9:46:23 PM UTC-8, Zach Borboa wrote: > > For anyone trying to debug this issue, you may want to print out the > variable using {{ csrf_token }} as well as using {% csrf_tok

Re: CSRF verification failed when I use smart phone

2015-01-28 Thread Zach Borboa
For anyone trying to debug this issue, you may want to print out the variable using {{ csrf_token }} as well as using {% csrf_token %} on the form to verify the token is correct. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe f

Re: CSRF verification failed when I use smart phone

2015-01-28 Thread Pouria M
Hi Everyone, I am facing a similar issue ... CSRF verification fails on IOS using chrome ... Appreciate any insights p On Friday, January 9, 2015 at 6:16:37 PM UTC-8, James Schneider wrote: > > Is the iframe sourced from the same domain as the main page that was > requested in the address ba

Re: CSRF verification failed. Request aborted.

2015-01-24 Thread Stephen J. Butler
Have you checked the rendered HTML in the browser? Is the CSRF element present? Is there any JavaScript that could be doing pre-processing on the form? Did you open up the browser's inspector and verify that the POST request actually included the CSRF key/value? Is it the correct value? On Sat, Ja

Re: CSRF verification failed. Request aborted.

2015-01-24 Thread Cornelio Royer Climent
Yes I have MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.Session

Re: CSRF verification failed. Request aborted.

2015-01-24 Thread Larry Martell
On Sat, Jan 24, 2015 at 2:51 PM, Cornelio Royer Climent wrote: > HI. SOMEBODY COULD YOU HELP WITH THIS ERROR? > > I THINEK THAT I SAW EVERYTHING, BUT I DON'T FIND THE ERROR . > > > > > {{ words.english }} > > > {% if error_message %}{{ error_message }}{% endif %} > > > > {% csrf_token %} > > >

Re: CSRF verification failed when I use smart phone

2015-01-09 Thread James Schneider
Is the iframe sourced from the same domain as the main page that was requested in the address bar? Is the action for the form pointing at a different domain than the one that generated it? -James Mobile device could also be caching an incorrect csrf token. -- You received this message because yo

Re: CSRF verification failed when I use smart phone

2015-01-09 Thread Sugita Shinsuke
Hi Zach Borboa Thank you for replying. Do you mean that both of PC and Mobile device are caching an incorrect csrf token? I use iframe. Child frame html page uses form, and can it use csrf? 2015年1月9日金曜日 15時14分55秒 UTC+9 Zach Borboa: > > Mobile device could also be caching an incorrect csrf toke

Re: CSRF verification failed when I use smart phone

2015-01-09 Thread Sugita Shinsuke
Hello Abraham V. Thank you for replying. It is nice idea. But, PC version also sometimes happened. less than Mobile 2015年1月8日木曜日 20時09分11秒 UTC+9 Abraham Varricatt: > > Can it be possible that you are rendering a different template (without > CSRF) for the mobile version? > > -Abraham V. > > >

Re: CSRF verification failed when I use smart phone

2015-01-08 Thread Zach Borboa
Mobile device could also be caching an incorrect csrf token. -- 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 t

Re: CSRF verification failed when I use smart phone

2015-01-08 Thread Abraham Varricatt
Can it be possible that you are rendering a different template (without CSRF) for the mobile version? -Abraham V. On Thursday, January 8, 2015 2:15:21 PM UTC+5:30, Sugita Shinsuke wrote: > > Hello Vijay Khemlani > > Thank you for replying. > But, of cause I appended the tag in my form like bel

Re: CSRF verification failed when I use smart phone

2015-01-08 Thread Sugita Shinsuke
Hello Vijay Khemlani Thank you for replying. But, of cause I appended the tag in my form like below {% csrf_token %} but I wonder about that using the iframe is bad. The form is child of iframe. I also checked Chrome's developer tool. The csrf token was saved in the cookie. 2015

Re: CSRF verification failed when I use smart phone

2015-01-06 Thread Vijay Khemlani
¿Did you include de {% csrf_token %} tag in the form? ¿Is it generating the corresponding hidden input tag in the html? On Tue, Jan 6, 2015 at 6:09 AM, Sugita Shinsuke wrote: > Hello. > > When I use Django via my smart phone Android and iOS. > The error sometimes occurred. > > Forbidden (403) >

Re: CSRF verification failed

2013-07-06 Thread Kakar Arunachal Service
Thank you Sanjay! On Sun, Jul 7, 2013 at 4:08 AM, Sanjay Bhangar wrote: > On Sat, Jul 6, 2013 at 9:38 AM, Kakar Arunachal Service < > kakararunachalserv...@gmail.com> wrote: > >> Hello! >> I am getting CSRF verification failed error, even after i added {% >> csrf_token %} tag in the html file. >

Re: CSRF verification failed

2013-07-06 Thread Sanjay Bhangar
On Sat, Jul 6, 2013 at 9:38 AM, Kakar Arunachal Service < kakararunachalserv...@gmail.com> wrote: > Hello! > I am getting CSRF verification failed error, even after i added {% > csrf_token %} tag in the html file. > > Here's my html file: > > {% extends "base.html" %} > {% block title %} User Regi

Re: 'CSRF verification failed." from django.contrib.comments. can you help solve it? django 1.3

2012-07-16 Thread brycenesbitt
It works now that I have fully uninstalled pybbm. Pybbm was incompatible with my app because it also extended the User object (something apparently you can only do once?) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: CSRF verification failed. Request aborted.

2012-07-11 Thread JJ Zolper
Thanks so much for the tip! I had part of the solution there from our other friend but I will add that extra protection when I can! Are you familiar with CSRF? And your solution what the issue you fix is? Any other insight into the reason for the code would be great! Thanks again, JJ On Wedn

Re: CSRF verification failed. Request aborted.

2012-07-11 Thread JJ Zolper
1. I don't think I set my id field just name title bio and website. 2. I don't set those two values. 3. not sure.. 4. not sure... I believe you corrected yourself as this post doesn't seem relevant. Not a problem! On Wednesday, July 11, 2012 8:11:46 AM UTC-4, Sergey Fursov wrote: > > Some notes

Re: CSRF verification failed. Request aborted.

2012-07-11 Thread JJ Zolper
Yep it's a problem with my views.py and my template or html page. My html page needed the csrf token tag: {% csrf_token %} and my view needed: return render_to_response('about.html', context_instance=RequestContext(request)) so thanks for the help!!! On Wednesday, July 11, 2012 7:58:5

Re: CSRF verification failed. Request aborted.

2012-07-11 Thread JJ Zolper
I apologize for not responding sooner! This line: return render_to_response('about.html', context_instance=RequestContext(request)) helped immensely! so in order for the render response method to work it has to have some sort of data/context of data passed along with it? I'm still tr

Re: CSRF verification failed. Request aborted.

2012-07-11 Thread Sergiy Khohlov
problem in view also : def about(request): if request.method == 'POST': return HttpResponseRedirect('/about/') elif request.method == 'GET': return render_to_response('about.html', context_instance=RequestContext(request)) else: raise Http404() this one should

Re: CSRF verification failed. Request aborted.

2012-07-11 Thread Сергей Фурсов
oops) 2012/7/11 Сергей Фурсов > Some notes about your models: > 1. why do you create id field manually? Django will do it for you ;) > 2. why do you explicitly set db_table and db_column? Do you have some > legacy database? If not, django will do it for you ;) > 3. move your vision from tables t

Re: CSRF verification failed. Request aborted.

2012-07-11 Thread Сергей Фурсов
Some notes about your models: 1. why do you create id field manually? Django will do it for you ;) 2. why do you explicitly set db_table and db_column? Do you have some legacy database? If not, django will do it for you ;) 3. move your vision from tables to objects 4. call your models in CamelCase

Re: CSRF verification failed. Request aborted.

2012-07-11 Thread Сергей Фурсов
Ok, I tried your code, just added in models.py fake owners model to correct foreign key class Owners(models.Model): num = models.IntegerField() def __unicode__(self): return unicode(self.num) and create views.py with three lines of code: def page(request): form = Webrequests

Re: CSRF verification failed. Request aborted.

2012-07-09 Thread Сергей Фурсов
as described in error message your view function have to use RequestContext for the template, instead of Context. your view should looks like def about(request): if request.method == 'POST': re

Re: 'CSRF verification failed." from django.contrib.comments. can you help solve it? django 1.3

2012-07-03 Thread Melvyn Sopacua
On 30-6-2012 8:39, brycenesbitt wrote: > {% csrf_token %} > > I render my form with: > {% render_comment_form for entry %} You should verify if the generated html looks sane. If you need help with that, put it up on dpaste. > --- > I should note it did work when I first added it to

Re: 'CSRF verification failed." from django.contrib.comments. can you help solve it? django 1.3

2012-06-29 Thread brycenesbitt
On Thursday, June 28, 2012 10:43:58 AM UTC-7, jonas wrote: > > After the starting form tag add {% csrf_token %} > I can't. It is rendered for me by {% render_comment_form for entry %} -- You received this message because you are subscribed to the Google Groups "Django users" group. To view thi

Re: 'CSRF verification failed." from django.contrib.comments. can you help solve it? django 1.3

2012-06-29 Thread brycenesbitt
The "security_hash" field that you see is part of the comments app, and is > not the CSRF token. That needs to be output by a {% csrf_token %} tag (or > its equivalent). If it's working, you should see another hidden input > field, which looks like this: > > > value="36d43c1652d5676d6d41

Re: 'CSRF verification failed." from django.contrib.comments. can you help solve it? django 1.3

2012-06-28 Thread Ian Clelland
On Thu, Jun 28, 2012 at 9:14 AM, brycenesbitt wrote: > I'm using django.contrib.comments and get 'CSRF token missing or > incorrect.' when previewing or submitting a comment. I have: ... The HTML looks like it has the csrf security_hash in the proper place: > > /> > > > ... The "secu

Re: 'CSRF verification failed." from django.contrib.comments. can you help solve it? django 1.3

2012-06-28 Thread Jonas Geiregat
On do, jun 28, 2012 at 09:14:36 -0700, brycenesbitt wrote: > http://127.0.0.1:8000/comments/post/>" method="post"> >/> >id="id_timestamp" /> >value="6e85e1c846861c80575ce435b21a855706725b00" id="id_security_hash" > /> After the starting form tag add {% csrf_token %} More

Re: CSRF verification failed. Request aborted.

2012-05-18 Thread doniyor
as Kurtis said, you need {% csrf_token %} and your rendering response should be something like this: return render_to_response('index.html', {'your_key': your_value},context_instance=RequestContext(request)) and those your value will be rendered thru youe_key tag. here is how your form sh

Re: CSRF verification failed. Request aborted.

2011-10-23 Thread ch3ka
On Sat, 22 Oct 2011 20:32:02 +0100 Kayode Odeyemi wrote: > On Sat, Oct 22, 2011 at 9:40 PM, wrote: > > Drupal cannot know about the CSRF token it has to send. > > > > You'd need to disable the CSRF-Check for that view. > > You can use the csrf_exempt decorator for example, found in the > > django

Re: CSRF verification failed. Request aborted.

2011-10-22 Thread Kayode Odeyemi
On Sat, Oct 22, 2011 at 9:40 PM, wrote: > On Sat, 22 Oct 2011 19:21:59 +0100 > Kayode Odeyemi wrote: > > > I am accessing my view from a Drupal application that sends in data > > via POST. I'm not using any REST API such as > > piston, django-tastypie. > > > > A few days ago, I'm smiling and hap

Re: CSRF verification failed. Request aborted.

2011-10-22 Thread web2 . 0+google
On Sat, 22 Oct 2011 19:21:59 +0100 Kayode Odeyemi wrote: > I am accessing my view from a Drupal application that sends in data > via POST. I'm not using any REST API such as > piston, django-tastypie. > > A few days ago, I'm smiling and happy that it all worked. Today, it's > a different story.

Re: CSRF verification failed. Request aborted.

2011-02-24 Thread Tom Evans
On Thu, Feb 24, 2011 at 10:00 AM, Ankit Rai wrote: > There is the problem "django1.2.5"  has some more security updates beacuse > of which your old code may break . Citation? > > Your code will start working after you add @csrf_exempt in all your views > .And cross check your settings.py middlew

Re: CSRF verification failed. Request aborted.

2011-02-24 Thread Kenneth Gonsalves
On Thu, 2011-02-24 at 15:30 +0530, Ankit Rai wrote: > Your code will start working after you add @csrf_exempt in all your > views why should he exempt all his views from csrf checking? -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- You received th

Re: CSRF verification failed. Request aborted.

2011-02-24 Thread Ankit Rai
There is the problem "django1.2.5" has some more security updates beacuse of which your old code may break . Your code will start working after you add @csrf_exempt in all your views .And cross check your settings.py middleware classes ('django.middleware.common.CommonMiddleware', 'django.contr

Re: CSRF verification failed. Request aborted.

2011-02-24 Thread Kenneth Gonsalves
On Thu, 2011-02-24 at 01:55 -0800, luca72 wrote: > (1, 2, 5, 'final', 0) and one more thing - how are you deploying? -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- You received this message because you are subscribed to the Google Groups "Django

Re: CSRF verification failed. Request aborted.

2011-02-24 Thread luca72
(1, 2, 5, 'final', 0) Thanks Luca On 24 Feb, 10:50, Ankit Rai wrote: > after removing add @csrf_exempt, it will work retsart the server. > > Which version of django are you using > to know version > type follwoing cmd > python > import django > django.VERSION > > On Thu, Feb 24, 2011 at 3:18 PM

Re: CSRF verification failed. Request aborted.

2011-02-24 Thread Ankit Rai
after removing add @csrf_exempt, it will work retsart the server. Which version of django are you using to know version type follwoing cmd python import django django.VERSION On Thu, Feb 24, 2011 at 3:18 PM, luca72 wrote: > removing @crsf_protect i get the same error > > On 24 Feb, 10:34, Kenn

Re: CSRF verification failed. Request aborted.

2011-02-24 Thread luca72
removing @crsf_protect i get the same error On 24 Feb, 10:34, Kenneth Gonsalves wrote: > On Thu, 2011-02-24 at 01:20 -0800, luca72 wrote: > > @csrf_protect > > try removing this > -- > regards > KGhttp://lawgon.livejournal.com > Coimbatore LUG roxhttp://ilugcbe.techstud.org/ -- You received thi

Re: CSRF verification failed. Request aborted.

2011-02-24 Thread Kenneth Gonsalves
On Thu, 2011-02-24 at 01:20 -0800, luca72 wrote: > @csrf_protect try removing this -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

Re: CSRF verification failed. Request aborted.

2011-02-24 Thread Kenneth Gonsalves
On Thu, 2011-02-24 at 00:54 -0800, luca72 wrote: > I get CSRF verification failed. Request aborted. after the submit you have to use RequestContext if you are using csrf - also make sure csrf middleware is loaded. -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techs

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-21 Thread Osiaq
Maybe decorate the view with @csrf_extempt and test it like this: ---views.py--- from django.core.context_processors import csrf from django.views.decorators.csrf import csrf_exempt @csrf_exempt def contact(request): form = ContactForm() ...some wicked logic here ... return render_to_re

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-21 Thread scabbage
I tried the following: 1. Change everything to use POST 2. Do $ curl -d "name=Bob&csrfmiddlewaretoken=926ab8c4fca858fdf0c441784687d402" http://localhost:8000/demo/test/ But I'm still getting the same CSRF error. Not sure why. Also, the token seems to stay the same after restarting the se

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-21 Thread scabbage
That's what I'm looking for. Thanks :) On Jan 20, 4:32 pm, Russell Keith-Magee wrote: > On Fri, Jan 21, 2011 at 4:40 AM, scabbage wrote: > > How do I include CSRF token in a curl request then? I use curl for > > debugging. Cannot seem to find any info on Google :( > > The CSRF token is just a h

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-20 Thread Russell Keith-Magee
On Fri, Jan 21, 2011 at 4:40 AM, scabbage wrote: > How do I include CSRF token in a curl request then? I use curl for > debugging. Cannot seem to find any info on Google :( The CSRF token is just a hidden field on your form. When you render your template, the CSRF token will be included on the re

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-20 Thread scabbage
How do I include CSRF token in a curl request then? I use curl for debugging. Cannot seem to find any info on Google :( On Jan 20, 5:11 am, Russell Keith-Magee wrote: > On Thu, Jan 20, 2011 at 8:57 PM, Shawn Milochik wrote: > > > On Jan 19, 2011, at 8:01 PM, scabbage wrote: > > >> Is there a way

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-20 Thread Russell Keith-Magee
On Thu, Jan 20, 2011 at 8:57 PM, Shawn Milochik wrote: > > On Jan 19, 2011, at 8:01 PM, scabbage wrote: > >> Is there a way to completely disable CSRF handling? > > Sure, just remove the CSRF middleware from your settings.py. While this advice is 100% accurate, I'd would *strongly* caution you no

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-20 Thread Shawn Milochik
On Jan 19, 2011, at 8:01 PM, scabbage wrote: > Is there a way to completely disable CSRF handling? Sure, just remove the CSRF middleware from your settings.py. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-20 Thread Daniel Roseman
On Wednesday, January 19, 2011 11:07:04 PM UTC, scabbage wrote: > > How do I add CSRF token to curl then? > > What if I wanna expose my views as web services without providing a > UI, how do I make sure clients (e.g. Ajax, actionscript, etc) can use > it without this CSRF issue? > > > Thanks.

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-19 Thread arlolra
maybe use something like piston https://bitbucket.org/jespern/django-piston/wiki/Home -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-19 Thread scabbage
Is there a way to completely disable CSRF handling? Is there an documentation about how to create web services APIs using Django without frontends? Thanks. On Jan 19, 3:26 pm, Andy McKay wrote: > > What if I wanna expose my views as web services without providing a > > UI, how do I make sure cl

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-19 Thread Andy McKay
> What if I wanna expose my views as web services without providing a > UI, how do I make sure clients (e.g. Ajax, actionscript, etc) can use > it without this CSRF issue? You can mark things as exempt if you'd like to and are aware of the implications: http://docs.djangoproject.com/en/dev/ref/c

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-19 Thread scabbage
How do I add CSRF token to curl then? What if I wanna expose my views as web services without providing a UI, how do I make sure clients (e.g. Ajax, actionscript, etc) can use it without this CSRF issue? Thanks. On Jan 19, 4:14 am, Jirka Vejrazka wrote: > > However, when I tried this: > > >  

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-19 Thread Martin Pajuste
curl -d "name=Bob" -G http://localhost:8000/demo/test -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@go

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-19 Thread Martin Pajuste
-d flag sends the specified data in a POST request to the HTTP server, since you don't supply CSRF token, Django assumes the post is malicious. See more http://docs.djangoproject.com/en/dev/ref/contrib/csrf/?from=olddocs -- You received this message because you are subscribed to the Google Group

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-19 Thread Jirka Vejrazka
> However, when I tried this: > >    $ curl -d "name=Bob" http://localhost:8000/demo/test curl -d sends data using POST method, not GET method (see curl documentation). Django expects CSRF token in all POST requests, check http://docs.djangoproject.com/en/dev/ref/contrib/csrf/ HTH Jirk

Re: CSRF verification failed. Request aborted.

2010-12-22 Thread Harbhag Singh Sohal
> What you're doing should be fine, in terms of whether it works or not. > However, I'd strongly recommend against passing locals(). While it may seem > to violate DRY to do anything else, experience has shown me that it makes > maintaining the code a lot harder in the long run, as it's not imme

Re: CSRF verification failed. Request aborted.

2010-12-22 Thread Dan Fairs
> from django.template import RequestContext > return render_to_response('abook_view.html', > locals(),context_instance=RequestContext(request)) What you're doing should be fine, in terms of whether it works or not. However, I'd strongly recommend against passing locals(). While it may seem to vi

Re: CSRF verification failed. Request aborted.

2010-12-22 Thread Harbhag Singh Sohal
from django.template import RequestContext return render_to_response('abook_view.html', locals(),context_instance=RequestContext(request)) this is what I am using. Is it ok ? -- Harbhag Singh Sohal http://harbhag.wordpress.com -- You received this message because you are subscribed to the Goog

Re: CSRF verification failed. Request aborted.

2010-12-22 Thread robos85
Do You pass *RequestContext* to your template during rendering it in view? Example from manual: def my_view(request): c = {} # ... return render_to_response("a_template.html", c, context_instance=RequestContext(request)) -- You received this message bec

Re: CSRF verification failed. Request aborted.

2010-12-22 Thread Harbhag Singh Sohal
I am also using {% csrf_token %}, even then I am getting error. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsub

Re: CSRF verification failed - 403 error

2010-07-17 Thread zenr
Hi I always had context_instance=RequestContext(request) in the render_to_response function. Is there anything else I need to check? Ravi On Jul 16, 5:23 pm, Joel Klabo wrote: > I had this same problem. Try this for your return statements, if > you're using render_to_response: > > return ren

Re: CSRF verification failed - 403 error

2010-07-16 Thread Joel Klabo
I had this same problem. Try this for your return statements, if you're using render_to_response: return render_to_response("a_template.html", c, context_instance=RequestContext(request)) The context_instance was the key in my case. You'll need to add it to all your views though. -- You receive