Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Blank page returned on POST if csrf middleware is not configured... bug?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Cal Leeming [Simplicity Media Ltd]  
View profile  
 More options Jul 6 2011, 10:43 am
From: "Cal Leeming [Simplicity Media Ltd]" <cal.leem...@simplicitymedialtd.co.uk>
Date: Wed, 6 Jul 2011 15:43:47 +0100
Local: Wed, Jul 6 2011 10:43 am
Subject: Blank page returned on POST if csrf middleware is not configured... bug?
Today I came across a very strange problem.

When attempting to post a form (without the CSRF middleware being
present in MIDDLEWARE_CLASSES), django would *always* return a blank
page. If the post contained no data, it would come back fine, but if
it did contain data, it would come back blank.

Upon adding the CSRF middleware into the MIDDLEWARE_CLASSES, and
adding {% csrf_token %} into the template, it would return back fine
(and without csrf_token - it would return back an exception, as it
should).

Although it is a good thing that it happened (because I did actually
forget to include CSRF middleware), I feel that Django should raise an
exception (if this is the default behaviour), to tell the user they
must enable CSRF middleware, rather than just returning a blank page.

Any thoughts??

Cal


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luke Plant  
View profile  
 More options Jul 6 2011, 12:41 pm
From: Luke Plant <L.Plant...@cantab.net>
Date: Wed, 06 Jul 2011 17:41:39 +0100
Local: Wed, Jul 6 2011 12:41 pm
Subject: Re: Blank page returned on POST if csrf middleware is not configured... bug?
On 06/07/11 15:43, Cal Leeming [Simplicity Media Ltd] wrote:

Sgreed, but there isn't enough information here to work out what is
going on. Please file a ticket if you can create a test case that will
reproduce it. I can't think of any code paths in Django that would
return 'a blank page' (though I'm not sure I know what you mean by that).

Luke

--
 A mosquito cried out in pain:
 "A chemist has poisoned my brain!"
 The cause of his sorrow
 was para-dichloro-
 diphenyltrichloroethane

Luke Plant || http://lukeplant.me.uk/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Cal Leeming [Simplicity Media Ltd]  
View profile  
 More options Jul 6 2011, 1:12 pm
From: "Cal Leeming [Simplicity Media Ltd]" <cal.leem...@simplicitymedialtd.co.uk>
Date: Wed, 6 Jul 2011 18:12:29 +0100
Local: Wed, Jul 6 2011 1:12 pm
Subject: Re: Blank page returned on POST if csrf middleware is not configured... bug?
Hi Luke,

Thanks for the reply.

I'll set up a test case in a fresh 1.2 django instance, and will let
you know the results (and the code used).

Cal


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luke Plant  
View profile  
 More options Jul 6 2011, 2:18 pm
From: Luke Plant <L.Plant...@cantab.net>
Date: Wed, 06 Jul 2011 19:18:35 +0100
Local: Wed, Jul 6 2011 2:18 pm
Subject: Re: Blank page returned on POST if csrf middleware is not configured... bug?
On 06/07/11 18:12, Cal Leeming [Simplicity Media Ltd] wrote:

> Hi Luke,

> Thanks for the reply.

> I'll set up a test case in a fresh 1.2 django instance, and will let
> you know the results (and the code used).

If it's not present in 1.3/trunk, there won't be bug fixes for it
(unless it is security related).

Luke

--
 A mosquito cried out in pain:
 "A chemist has poisoned my brain!"
 The cause of his sorrow
 was para-dichloro-
 diphenyltrichloroethane

Luke Plant || http://lukeplant.me.uk/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Cal Leeming [Simplicity Media Ltd]  
View profile  
 More options Jul 6 2011, 2:22 pm
From: "Cal Leeming [Simplicity Media Ltd]" <cal.leem...@simplicitymedialtd.co.uk>
Date: Wed, 6 Jul 2011 19:22:11 +0100
Local: Wed, Jul 6 2011 2:22 pm
Subject: Re: Blank page returned on POST if csrf middleware is not configured... bug?
Ah, okay I'll do it on both 1.2 and 1.3 to determine if it is/was a bug.

Cal


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Cal Leeming [Simplicity Media Ltd]  
View profile  
 More options Jul 6 2011, 4:54 pm
From: "Cal Leeming [Simplicity Media Ltd]" <cal.leem...@simplicitymedialtd.co.uk>
Date: Wed, 6 Jul 2011 21:54:03 +0100
Local: Wed, Jul 6 2011 4:54 pm
Subject: Re: Blank page returned on POST if csrf middleware is not configured... bug?
Hi Luke,

Strange, I performed a bare test and I can't seem to reproduce the
problem. I then tried to replicate the problem in the existing code,
and it doesn't happen any more.

Some changes were being made earlier today to our L7 traffic
inspection appliance, so I suspect this might have been the reason for
the blank result on POST (perhaps I hit it in the middle of a change
being made to the appliance rules).

Always annoying to not know 100% what caused a bug :X

Thanks for the quick response anyway, in future I'll make sure to test
on a fresh install before posting to django-developers.

Cal

On Wed, Jul 6, 2011 at 7:22 PM, Cal Leeming [Simplicity Media Ltd]


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »