Login

Snippets by krvss

Snippet List

Manual CSRF check for Django Facebook canvas applications

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. You only need to perform manual check when there is no correct signed_request present in your request - correct request means you really deal with FB. Use facebook_csrf_check to verify POST requests when signed_request is absent.

  • django
  • python
  • post
  • facebook
  • csrf
  • fb
Read More

Keep Me Logged In for Django

Very simple middleware to implement "remember me" functionality. Updates the session once per day to keep user logged.

  • django
  • session
  • keep
  • logged
  • middlware
Read More

krvss has posted 2 snippets.