Wednesday, July 25, 2012

Registering users with django_facebook

Hoping to save you some sanity with this one.

Thierry Schellenback's django_facebook module promises to make life easy for Django developers to instantly hook into facebook for their registration and login needs. This is kind of true. Unfortunately the documentation is way too sparse and it's missing a critical explanation: how to redirect the user after registration.

The default code redirects to Thierry's demo page after registration. It took me forever to figure out how to override this. It turned out to take only one extra parameter in the registration POST:

His examples use the "next" hidden param and it works as expected during the login flow. But registration requires the "register_next" hidden param. That's it.

Hope this saves you some time.