A generic system for interacting with remote APIs that need to create Django socials.
Project description
Introduction
The Django-Simple-Social library downloads a collection of social network libraries and provides automatic backends, and interfaces for working with them. The goal of this project is to simplify working with third-party apps and authorization tools, such as Facebook, LinkedIn, and Twitter.
Make sure you also read up on Djagno-Social-User, as it provides the foundational infrastructure for this library:
Keep in mind this library is still under development, so there may be breaking changes. I’ll update the documentation anytime that happens, but feel free to contact me as well.
All functions and classes are documented inline. If you have additional questions, I can be reached on github or at admin@mattsnider.com.
Getting started
Standard stuff applies to install. Use PIP to install with dependencies:
pip install django-simple-social
Or install from the command line:
python setup.py install
Dependencies
There many dependencies for this library, because it requires APIs for working with each social network:
django 1.3 or greater Django-Social-User LinkedIn-API-JSON-Client twython
Usage Guide
Register any social network backends you want to use in your settings.py:
- AUTHENTICATION_BACKENDS = (
‘django_simple_social.backends.LinkedInBackend’, ‘django_simple_social.backends.TwitterBackend’, … ‘django.contrib.auth.backends.ModelBackend’)
Add any required API keys (backend dependent) to settings.py, here are some examples:
LINKED_IN_CONSUMER_KEY = ‘asdf’ LINKED_IN_CONSUMER_SECRET = ‘asdf’ TWITTER_CONSUMER_KEY = ‘asdf’ TWITTER_CONSUMER_SECRET = ‘asdf’
Run the backend autodiscover in urls.py:
import django_simple_social; django_simple_social.autodiscover()
Include references to Django-Social-User urls in urls.py:
- urlpatterns = patterns(‘’,
… url(r’^social/’, include(‘django_social_user.urls’, namespace=’django_social_user’)), … (r’^admin/’, include(admin.site.urls)),)
To begin the oauth process with a social network, expose the following link to an enduser:
<a href=”{% url ‘django_social_user:authorize’ ‘linkedin’ %}”>Sign in with LinkedIn</a> <a href=”{% url ‘django_social_user:authorize’ ‘twitter’ %}”>Sign in with Twitter</a>
Todo
Support facebook
Support google
Support openid
Better error handling
Asynchronous/JS driven authentication, instead of browser redirects
Decouple APIs from this infrastructure and allow API customization
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-simple-social-0.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44a4dc8b42aaefbefac6d1f24c6c394c3ce10d972411e9a4f718d68fbe5a5751 |
|
MD5 | 0b7aabf9e476256cd17c5f4a0c5c5111 |
|
BLAKE2b-256 | bf7c58b94fe06b7c838f6120d122325bda210c93b148eb036837e752a9783842 |
Hashes for django-simple-social-0.1.6.macosx-10.7-intel.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 020d99f0c5e924697949c9931ac5c9207f900723ab9ffb590f8510985edf6aaf |
|
MD5 | bdf58d4950a0e2c9f8785014ed21a584 |
|
BLAKE2b-256 | fceedbd10b5cae0b899de9b02ac2326d7ea1365a6d4a71b087114697c360b703 |