| 1 |
Reddit |
| 2 |
------ |
| 3 |
|
| 4 |
App registration (get your key and secret here) |
| 5 |
https://www.reddit.com/prefs/apps/ |
| 6 |
|
| 7 |
Development callback URL |
| 8 |
http://localhost:8000/accounts/reddit/login/callback/ |
| 9 |
|
| 10 |
By default, access to Reddit is temporary. You can specify the ``duration`` |
| 11 |
auth parameter to make it ``permanent``. |
| 12 |
|
| 13 |
You can optionally specify additional permissions to use. If no ``SCOPE`` |
| 14 |
value is set, the Reddit provider will use ``identity`` by default. |
| 15 |
|
| 16 |
In addition, you should override your user agent to comply with Reddit's API |
| 17 |
rules, and specify something in the format |
| 18 |
``<platform>:<app ID>:<version string> (by /u/<reddit username>)``. Otherwise, |
| 19 |
you will risk additional rate limiting in your application. |
| 20 |
|
| 21 |
.. code-block:: python |
| 22 |
|
| 23 |
SOCIALACCOUNT_PROVIDERS = { |
| 24 |
'reddit': { |
| 25 |
'AUTH_PARAMS': {'duration': 'permanent'}, |
| 26 |
'SCOPE': ['identity', 'submit'], |
| 27 |
'USER_AGENT': 'django:myappid:1.0 (by /u/yourredditname)', |
| 28 |
} |
| 29 |
} |