| 1 |
Tumblr (OAuth 2) |
| 2 |
---------------- |
| 3 |
|
| 4 |
You will need to create a Tumblr app and configure the Tumblr provider for |
| 5 |
your Django application via the admin interface. |
| 6 |
|
| 7 |
App registration |
| 8 |
**************** |
| 9 |
|
| 10 |
To register an app on Tumblr you will need a Tumblr account. With an account, you |
| 11 |
can create a new app via:: |
| 12 |
|
| 13 |
https://www.tumblr.com/oauth/register |
| 14 |
|
| 15 |
In the app creation form fill in the development callback URL:: |
| 16 |
|
| 17 |
http://127.0.0.1:8000/accounts/tumblr_oauth2/login/callback/ |
| 18 |
|
| 19 |
For production use a callback URL such as:: |
| 20 |
|
| 21 |
https://{{yourdomain}}.com/accounts/tumblr_oauth2/login/callback/ |
| 22 |
|
| 23 |
|
| 24 |
App database configuration through admin |
| 25 |
**************************************** |
| 26 |
|
| 27 |
The second part of setting up the Tumblr provider requires you to configure |
| 28 |
your Django application. Configuration is done by creating a SocialApp object |
| 29 |
in the admin. Add a social app on the admin page:: |
| 30 |
|
| 31 |
/admin/socialaccount/socialapp/ |
| 32 |
|
| 33 |
Use the tumblr keys tab of your application to fill in the form. It's located:: |
| 34 |
|
| 35 |
https://www.tumblr.com/oauth/apps |
| 36 |
|
| 37 |
The configuration is as follows: |
| 38 |
|
| 39 |
* Provider, "Tumblr" |
| 40 |
* Name, your pick, suggest "Tumblr" |
| 41 |
* Client id, is called "OAuth2.0 Client ID" on Tumblr |
| 42 |
* Secret key, is called "OAuth2.0 Client Secret" on Tumblr |
| 43 |
* Key, is not needed, leave blank |
| 44 |
|
| 45 |
|
| 46 |
You can also set up the provider in `settings.py`:: |
| 47 |
|
| 48 |
SOCIALACCOUNT_PROVIDERS = { |
| 49 |
"tumblr": { |
| 50 |
"SCOPE": ["basic", "write"], |
| 51 |
"APP": { |
| 52 |
"client_id": os.environ.get("TUMBLR_CLIENT_ID", ""), |
| 53 |
"secret": os.environ.get("TUMBLR_CLIENT_SECRET", ""), |
| 54 |
"key": "", |
| 55 |
}, |
| 56 |
}, |
| 57 |
} |
| 58 |
|
| 59 |
For more information about the Tumblr API, see:: |
| 60 |
|
| 61 |
https://www.tumblr.com/docs/en/api/v2 |