Historical content: I wrote this article over 8 years ago on 2008-12-28. You are viewing an archived post from my old WordPress blog. The archive contains over 1,600 articles written over a ten year period. The formatting and contents of the posts may not display perfectly.
On my site, I have some resources that are private, such as certain blog entries and photos. I wanted to make it so that my Facebook friends could log into my site without me having to create Django-based accounts for them. It turned out to be fairly trivial to get things set up, but I thought I'd share what I did in case it can be of use to anyone else.
This middleware will look for the cookies set when a Facebook Connect user authenticates to your site, read those cookies, determine if the logged in user is your Facebook friend and then log that user into your Django-powered site.