[http://code.google.com/p/pyfacebook/ PyFacebook] has Django middleware and view decorators (and eventually context processors and template tags) that allow you to write either internal or external Facebook applications. See [http://wiki.developers.facebook.com/index.php/Python the Facebook Wiki entry on Python] for more information.