A reusable app which makes it easy to use Twitter's "Sign In With Twitter" authentication mechanism.
- Put the
django_siwt
folder somewhere on your pythonpath. - Add
django_siwt
to yourINSTALLED_APPS
. There are no models, ergo there's no need for syncdb. - Make sure to set
CONSUMER_KEY
andCONSUMER_SECRET
in yoursettings.py
. - Include
django_siwt
's urls somewhere convenient (say, your project's urls.py). - Add some links to
django_siwt
'ssignin
/signout
views from within your templates. Easily accomplished using theurl
tag:{% url siwt_signin %}
and{% url siwt_signout %}
.
Take a look in utils.py
for a few more tweakable knobs.
This project is a cleaned-up, reusable-app-ified version of henriklied's django-twitter-oauth. That application used the standard authentication flow and not "Sign In With Twitter", though the distinction appears largely academic as both seem to operate fine. I wanted to use the sanctioned way though, hence the modifications.
This code is yours to use and modify according to the terms of the BSD License, the full text of which is available in LICENSE.txt or at http://opensource.org/licenses/bsd-license.php