From 442c80560535acc6ac0db8cd4ca377467e7e9299 Mon Sep 17 00:00:00 2001 From: Sean Lee Date: Thu, 7 Jun 2012 13:32:47 +0800 Subject: [PATCH] added docs & setting example for douban support --- doc/backends/douban.rst | 20 ++++++++++++++++++++ doc/backends/index.rst | 1 + example/local_settings.py.template | 2 ++ example/settings.py | 1 + 4 files changed, 24 insertions(+) create mode 100644 doc/backends/douban.rst diff --git a/doc/backends/douban.rst b/doc/backends/douban.rst new file mode 100644 index 0000000..9e09642 --- /dev/null +++ b/doc/backends/douban.rst @@ -0,0 +1,20 @@ +Douban +======= + +Douban OAuth works similar to Twitter. +Douban offers per application keys named ``Consumer Key`` and ``Consumer Secret``. +To enable Douban oauth these two keys are needed. Further documentation at +`Douban Services & API`_: + +- Register a new application at `DOUBAN API KEY`_, + +- mark the **web application** checkbox. + +- Fill **Consumer Key** and **Consumer Secret** values in settings:: + + DOUBAN_CONSUMER_KEY + DOUBAN_CONSUMER_SECRET + + +.. _Douban Services & API: http://www.douban.com/service/ +.. _Douban API KEY: http://www.douban.com/service/apikey/apply diff --git a/doc/backends/index.rst b/doc/backends/index.rst index 5172998..b25d30d 100644 --- a/doc/backends/index.rst +++ b/doc/backends/index.rst @@ -23,3 +23,4 @@ Contents: skyrock yahoo evernote + douban diff --git a/example/local_settings.py.template b/example/local_settings.py.template index c20f800..3df3d42 100644 --- a/example/local_settings.py.template +++ b/example/local_settings.py.template @@ -33,6 +33,8 @@ GITHUB_APP_ID = '' GITHUB_API_SECRET = '' FOURSQUARE_CONSUMER_KEY = '' FOURSQUARE_CONSUMER_SECRET = '' +DOUBAN_CONSUMER_KEY = '' +DOUBAN_CONSUMER_SECRET = '' YANDEX_OAUTH2_CLIENT_KEY = '' YANDEX_OAUTH2_CLIENT_SECRET = '' YANDEX_OAUTH2_API_URL = 'https://api-yaru.yandex.ru/me/' # http://api.moikrug.ru/v1/my/ for Moi Krug diff --git a/example/settings.py b/example/settings.py index 46ae9e7..4af588c 100644 --- a/example/settings.py +++ b/example/settings.py @@ -83,6 +83,7 @@ AUTHENTICATION_BACKENDS = ( 'social_auth.backends.contrib.yahoo.YahooOAuthBackend', 'social_auth.backends.OpenIDBackend', 'social_auth.backends.contrib.livejournal.LiveJournalBackend', + 'social_auth.backends.contrib.douban.DoubanBackend', 'social_auth.backends.browserid.BrowserIDBackend', 'social_auth.backends.contrib.vkontakte.VKontakteBackend', 'social_auth.backends.contrib.yandex.YandexOAuth2Backend', -- 2.39.5