Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 91 lines (67 sloc) 2.938 kb
5eba5c7 @flashingpumpkin Social registration application for django
flashingpumpkin authored
1 ==========================
2 Django Social Registration
3 ==========================
4
5 Django Social Registration enables developers to add alternative registration
6 methods based on third party sites.
7
1c5ac30 @flashingpumpkin README update
flashingpumpkin authored
8
5eba5c7 @flashingpumpkin Social registration application for django
flashingpumpkin authored
9 Requirements
10 ============
1c5ac30 @flashingpumpkin README update
flashingpumpkin authored
11 - django
12 - oauth2
13 - python-openid
d80b6c4 @flashingpumpkin Updated the facebook parts to use the new GraphAPI and the "official"…
flashingpumpkin authored
14 - python-sdk_
5eba5c7 @flashingpumpkin Social registration application for django
flashingpumpkin authored
15
16 Installation
17 ============
18
0be94e7 @flashingpumpkin README update
flashingpumpkin authored
19 #. Add the ``socialregistration`` directory to your ``PYTHON_PATH``.
20 #. Add ``socialregistration`` to your ``INSTALLED_APPS`` settings of Django.
21 #. Add ``socialregistration.urls`` to your ``urls.py`` file.
5eba5c7 @flashingpumpkin Social registration application for django
flashingpumpkin authored
22
23 Configuration
24 =============
25
26 Facebook Connect
27 ----------------
1c5ac30 @flashingpumpkin README update
flashingpumpkin authored
28 #. Add ``FACEBOOK_API_KEY`` and ``FACEBOOK_SECRET_KEY`` to your settings file representing the keys you were given by Facebook.
0be94e7 @flashingpumpkin README update
flashingpumpkin authored
29 #. Add ``socialregistration.auth.FacebookAuth`` to ``AUTHENTICATION_BACKENDS`` in your settings file.
d80b6c4 @flashingpumpkin Updated the facebook parts to use the new GraphAPI and the "official"…
flashingpumpkin authored
30 #. Add ``socialregistration.middleware.FacebookMiddleware`` to ``MIDDLEWARE_CLASSES`` in your settings file.
0be94e7 @flashingpumpkin README update
flashingpumpkin authored
31 #. Add tags to your template file::
5eba5c7 @flashingpumpkin Social registration application for django
flashingpumpkin authored
32
0847254 @flashingpumpkin Updated README
flashingpumpkin authored
33 {% load facebook_tags %}
34 {% facebook_button %}
35 {% facebook_js %}
36
5eba5c7 @flashingpumpkin Social registration application for django
flashingpumpkin authored
37 Twitter
38 -------
1c5ac30 @flashingpumpkin README update
flashingpumpkin authored
39 #. Add the following variables to your ``settings.py`` file with the values you were given by Twitter::
5eba5c7 @flashingpumpkin Social registration application for django
flashingpumpkin authored
40
0847254 @flashingpumpkin Updated README
flashingpumpkin authored
41 TWITTER_CONSUMER_KEY
42 TWITTER_CONSUMER_SECRET_KEY
43 TWITTER_REQUEST_TOKEN_URL
44 TWITTER_ACCESS_TOKEN_URL
45 TWITTER_AUTHORIZATION_URL
5eba5c7 @flashingpumpkin Social registration application for django
flashingpumpkin authored
46
0be94e7 @flashingpumpkin README update
flashingpumpkin authored
47 #. Add ``socialregistration.auth.TwitterAuth`` to your ``AUTHENTICATION_BACKENDS`` settings.
48
49 #. Add tags to your template file::
16b3437 @flashingpumpkin Modified README
flashingpumpkin authored
50
0847254 @flashingpumpkin Updated README
flashingpumpkin authored
51 {% load twitter_tags %}
52 {% twitter_button %}
5eba5c7 @flashingpumpkin Social registration application for django
flashingpumpkin authored
53
0be94e7 @flashingpumpkin README update
flashingpumpkin authored
54
5eba5c7 @flashingpumpkin Social registration application for django
flashingpumpkin authored
55 Other OAuth Services
56 --------------------
0be94e7 @flashingpumpkin README update
flashingpumpkin authored
57 Please refer to the Twitter implementation of the signup / login process to
df02e88 @flashingpumpkin README update
flashingpumpkin authored
58 extend your own application to act as a consumer of other OAuth providers.
59 Basically it's just plugging together some urls and creating an auth backend,
60 a model and a view.
61
5eba5c7 @flashingpumpkin Social registration application for django
flashingpumpkin authored
62
63 OpenID
64 ------
0be94e7 @flashingpumpkin README update
flashingpumpkin authored
65 #. Add ``socialregistration.auth.OpenIDAuth`` to ``AUTHENTICATION_BACKENDS`` in your settings.
66 #. Add tags to your template file::
67
0847254 @flashingpumpkin Updated README
flashingpumpkin authored
68 {% load openid_tags %}
69 {% openid_form %}
32647a3 @flashingpumpkin README and setup.py update
flashingpumpkin authored
70
9a7882b @flashingpumpkin README update
flashingpumpkin authored
71 Logging users out
72 -----------------
73 You can use the standard {% url auth_logout %} url to log users out of Django.
d80b6c4 @flashingpumpkin Updated the facebook parts to use the new GraphAPI and the "official"…
flashingpumpkin authored
74 Please note that this will not log users out of third party sites though. Logging out a
75 Facebook user might look something like this::
1c5ac30 @flashingpumpkin README update
flashingpumpkin authored
76
d80b6c4 @flashingpumpkin Updated the facebook parts to use the new GraphAPI and the "official"…
flashingpumpkin authored
77 <a href="#" onclick="javascript:FB.logout(function(response){ document.location = '{% url auth_logout %}' })">Logout</a>
9a7882b @flashingpumpkin README update
flashingpumpkin authored
78
1c5ac30 @flashingpumpkin README update
flashingpumpkin authored
79 To log users out of other third party sites, I recommend redirecting them further to the OAuth / OpenID providers after they logged out of your site.
0be94e7 @flashingpumpkin README update
flashingpumpkin authored
80
c57cb9c @flashingpumpkin Added a bit less ambiguous text to some templates and added HTTPS
flashingpumpkin authored
81 HTTPS
82 -----
0be94e7 @flashingpumpkin README update
flashingpumpkin authored
83 If you wish everything to go through HTTPS, set ``SOCIALREGISTRATION_USE_HTTPS`` in your settings file to
84 ``True``.
c57cb9c @flashingpumpkin Added a bit less ambiguous text to some templates and added HTTPS
flashingpumpkin authored
85
32647a3 @flashingpumpkin README and setup.py update
flashingpumpkin authored
86 Other Information
87 -----------------
0847254 @flashingpumpkin Updated README
flashingpumpkin authored
88 If you don't wish your users to be redirected to the setup view to create a username but rather have
0be94e7 @flashingpumpkin README update
flashingpumpkin authored
89 a random username generated for them, set ``SOCIALREGISTRATION_GENERATE_USERNAME`` in your settings file to ``True``.
d80b6c4 @flashingpumpkin Updated the facebook parts to use the new GraphAPI and the "official"…
flashingpumpkin authored
90
91 .. _python-sdk: http://github.com/facebook/python-sdk
Something went wrong with that request. Please try again.