Skip to content

Commit

Permalink
README update
Browse files Browse the repository at this point in the history
  • Loading branch information
flashingpumpkin committed Apr 13, 2010
1 parent 48bea08 commit 0be94e7
Showing 1 changed file with 27 additions and 21 deletions.
48 changes: 27 additions & 21 deletions README.rst
Expand Up @@ -8,66 +8,70 @@ methods based on third party sites.
Requirements
============
django
oauth
oauth2
python-openid
pyfacebook

Installation
============

#. Add the *socialregistration* directory to your *PYTHON_PATH*.
#. Add *socialregistration* to your *INSTALLED_APPS* settings of Django.
#. Add *socialregistration.urls* to your *urls.py* file.
#. Add the ``socialregistration`` directory to your ``PYTHON_PATH``.
#. Add ``socialregistration`` to your ``INSTALLED_APPS`` settings of Django.
#. Add ``socialregistration.urls`` to your ``urls.py`` file.

Configuration
=============

Facebook Connect
----------------
#. Add *FACEBOOK_API_KEY* and *FACEBOOK_SECRET_KEY* to your settings file
#. Add ``FACEBOOK_API_KEY`` and ``FACEBOOK_SECRET_KEY`` to your settings file
representing the keys you were given by Facebook.
#. Add *socialregistration.auth.FacebookAuth* to *AUTHENTICATION_BACKENDS* in your settings file.
#. Add 'facebook.djangofb.FacebookMiddleware' to *MIDDLEWARE_CLASSES* in your settings file.
-> http://wiki.developers.facebook.com/index.php/User:PyFacebook_Tutorial#Add_the_middleware
#. Add ``socialregistration.auth.FacebookAuth`` to ``AUTHENTICATION_BACKENDS`` in your settings file.
#. Add ``facebook.djangofb.FacebookMiddleware`` to ``MIDDLEWARE_CLASSES`` in your settings file.
See: http://wiki.developers.facebook.com/index.php/User:PyFacebook_Tutorial#Add_the_middleware

#. Add tags to your template file:
#. Add tags to your template file::

{% load facebook_tags %}
{% facebook_button %}
{% facebook_js %}

#. If you wish on using the pyfacebook library to do API calls instead of the JavaScript
lib, add *socialregistration.middleware.FacebookMiddleware* to *MIDDLEWARE_CLASSES*
#. If you want to use the pyfacebook library to do API calls to Facebook, add
``socialregistration.middleware.FacebookMiddleware`` to your ``MIDDLEWARE_CLASSES`` setting.


Twitter
-------
#. Add the following variables to your *settings.py* file with the values you
were given by Twitter:
#. Add the following variables to your ``settings.py`` file with the values you
were given by Twitter::

TWITTER_CONSUMER_KEY
TWITTER_CONSUMER_SECRET_KEY
TWITTER_REQUEST_TOKEN_URL
TWITTER_ACCESS_TOKEN_URL
TWITTER_AUTHORIZATION_URL

#. Add *socialregistration.auth.TwitterAuth* to *AUTHENTICATION_BACKENDS* in your settings file.
#. Add ``socialregistration.auth.TwitterAuth`` to your ``AUTHENTICATION_BACKENDS`` settings.

#. Add tags to your template file::

#. Add tags to your template file:
{% load twitter_tags %}
{% twitter_button %}


Other OAuth Services
--------------------
Please refer to the Twitter implementation of the signup / login process to
Please refer to the Twitter implementation of the signup / login process to
extend your own application to act as a consumer of other OAuth providers.
Basically it's just plugging together some urls and creating an auth backend,
a model and a view.


OpenID
------
#. Add *socialregistration.auth.OpenIDAuth* to *AUTHENTICATION_BACKENDS* in your settings file.
#. Add tags to your template file:
#. Add ``socialregistration.auth.OpenIDAuth`` to ``AUTHENTICATION_BACKENDS`` in your settings.
#. Add tags to your template file::

{% load openid_tags %}
{% openid_form %}

Expand All @@ -80,12 +84,14 @@ wiki ->
http://wiki.developers.facebook.com/index.php/Connect/Authorization_Websites#Logging_Out_Users
<a href="#" onclick="FB.Connect.logoutAndRedirect('{% url auth_logout %}')">Logout</a>

To log users out of other third party sites, I recommend redirecting them further to the OAuth / OpenID providers.

HTTPS
-----
If you wish everything to go through HTTPS, set *SOCIALREGISTRATION_USE_HTTPS* in your settings file to
True
If you wish everything to go through HTTPS, set ``SOCIALREGISTRATION_USE_HTTPS`` in your settings file to
``True``.

Other Information
-----------------
If you don't wish your users to be redirected to the setup view to create a username but rather have
a username generated for them, set *SOCIALREGISTRATION_GENERATE_USERNAME* in your settings file to True
a random username generated for them, set ``SOCIALREGISTRATION_GENERATE_USERNAME`` in your settings file to ``True``.

0 comments on commit 0be94e7

Please sign in to comment.