Open kitsunde opened 11 years ago
This kind of makes me twitch. It would be better to do it in the view, class based views would be good for this - we make one that changes the dispatch and then use that for facebook views. but then this would be hard to understand if we secretly swap gets and posts.
This doesn't sound like a problem with an easy solution...
We are already doing it in the class based views, the problem is that we would need to override every single generic view to handle facebook requests. Which is a bit silly as the facebook request is really a GET in disguise since it's not doing a destructive operation.
I'm more worried if there's things in Django that will break if we change the verb mid request while having POST data.
Lots of the generic vies test post and get... So I'm also not sure. On 23 Jan 2013 12:54, "Kit Sunde" notifications@github.com wrote:
We are already doing it in the class based views, the problem is that we would need to override every single generic view to handle facebook requests. Which is a bit silly as the facebook request is really a GET in disguise since it's not doing a destructive operation.
I'm more worried if there's things in Django that will break if we change the verb mid request while having POST data.
— Reply to this email directly or view it on GitHubhttps://github.com/mediapop/django-friendface/issues/43#issuecomment-12581593.
Ah but this would be when a decoded signed_request
is pressent. Regular POST would work the same.
Oh actually that's a good point, I could try to run djangos tests with the middleware in place.
I like this idea. Because it'll make Facebook behave like a normal web page. So it'll make it easier to get going with doing Facebook.
I definitely think it's worth testing at least!
If say you put it as the last middleware.