python setup.py installor add the repository to your pip requirements file.
'clortho'to INSTALLED_APPS in settings.py
'clortho.auth_backends.FacebookBackend'to AUTHENTICATION_BACKENDS in settings.py.
Add the following entry to your project-level urls.py
Add the following settings to settings.py
# Facebook app secret key. FACEBOOK_SECRET_KEY = 'value_here' # Facebook app id. FACEBOOK_APP_ID = 'value_here' # Will serve as username prefix. FACEBOOK_USER_NAMESPACE = 'fb-' # Name of url to redirect to after authentication. CLORTHO_AUTH_REDIRECT = 'home'
Optionally, add 'clortho.context_processors.facebook_api_values' to your TEMPLATE_CONTEXT_PROCESSORS if you'd like a global FACEBOOK_APP_ID context variable for your Facebook JS.
Follow the included file
Once you have integrated your login and logout methods based on the above example, please run the following command in your projects base directory. After restarting your server,
django-clorthowill be available to use.
python manage.py syncdb
- Add other social backends (Twitter, Google Oauth2, Yahoo OpenID, etc.)
- Add convenience methods to model for easy API lookups.
- Add methods to allow existing users to connect with various services.
This project came to be while I started rewriting my 14 year old Ghostbusters
fan site in Python. I wanted a simple pluggable app to tie into the latest
Facebook and Twitter APIs and authentication schemes. Named after
Vinz Clortho, Keymaster of Gozer,
django-clortho will eventually provide
OAuth 2.0-based authentication backends to Facebook Graph API and Twitter Oauth, among others.