djangosnippets.org: Latest snippets tagged with 'post'http://djangosnippets.org/tags/post/2016-08-22T07:45:00.019640-05:00Django AJAX Form View
2016-08-22T07:45:00.019640-05:00daveamatohttp://djangosnippets.org/snippets/10582/<h1>Django AJAX Form View</h1>
<h3>A simple example for an AJAX-powered view</h3>
Freely redistributableGoogle URL Shortner using Python requests
2015-05-17T20:31:21.974850-05:00akshayw39http://djangosnippets.org/snippets/10486/<p>This code can convert a url to short url using google URL Shortener API https://developers.google.com/url-shortener/v1/getting_started </p>
Freely redistributableAllow separation of GET and POST implementations
2012-06-14T14:16:38.364756-05:00agorehttp://djangosnippets.org/snippets/2768/<p>Django does not have a clean, built-in mechanism to separate GET and POST implementations. This simple decorator provides this behavior. Django does provide an alternate way using class-based views, but defining class for each of your view functions may be an overkill. You can name the get and post functions …</p>
Freely redistributableManual CSRF check for Django Facebook canvas applications
2011-09-05T07:15:18.260157-05:00krvsshttp://djangosnippets.org/snippets/2538/<p>The way to manually control CSRF correctness for FB applications. Automatic check cannot be used because FB does POST on your canvas URL when initializing your application without CSRF token. If you still want to use Django CSRF stuff do manual checks.</p>
<p>You only need to perform manual check when …</p>
Freely redistributableBypass CSRF check for Facebook canvas apps using POST for canvas
2010-11-23T21:39:44.773031-06:00mjalldayhttp://djangosnippets.org/snippets/2272/<p>This assumes that you have a method called <strong>decode_signed_request</strong> which will validate the signed_request parameter and return None if the validation check fails.</p>
<p>A similar method can be found here - https://github.com/iplatform/pyFaceGraph/blob/70e456c79f1ac1c7eddece03af323346a00481ef/src/facegraph/canvas.py</p>
Freely redistributableGet boolean value from request send by Ajax
2009-07-01T05:14:27.208142-05:00zalunhttp://djangosnippets.org/snippets/1608/<p>gets the value from request and returns it's boolean state</p>
Freely redistributableprevent GET or POST requests
2007-12-11T06:06:34.430878-06:00jerzykhttp://djangosnippets.org/snippets/505/<p>This will return HTTP 405 if request was not POSTed.
same way you can forbide POST request, change 'POST' to 'GET'
</p>
<p>Decorators provided for your convenience.
</p>
Freely redistributable