django-socialnetwork 0.0.6
pip install django-socialnetwork
Released:
Provides functionality to login and share with social networks to Django.
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Apache Software License (Apache License (2.0))
- Author: Gabriel González
Classifiers
- Development Status
- Environment
- Framework
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Project description
django-socialnetwork
This packages provides login and share funcionalities for the social networks.
Installation
pip install django-socialnetwork
Basic usage
Add socialnetwork to INSTALLED_APPS.
INSTALLED_APPS = (
...
...
'socialnetwork',
'socialnetwork.facebook',
...
...
)
Set your social app configuration in settings.
SOCIALNETWORK_FACEBOOK_CLIENT_ID = '0123456789'
SOCIALNETWORK_FACEBOOK_CLIENT_SECRET = '0123456789abcdefgh'
SOCIALNETWORK_FACEBOOK_SCOPE_PERMISSIONS = ['email', ...]
Add the social backends to your AUTHENTICATION_BACKENDS.
AUTHENTICATION_BACKENDS = (
...
...
'socialnetwork.facebook.backends.FacebookBackend',
...
...
)
Add socialnetwork to your urls.
urlpatterns = patterns('',
...
...
url(r'^social/', include('socialnetwork.urls', namespace='socialnetwork')),
...
...
)
Show login button in your templates.
...
...
{% load facebook %}
...
...
{% facebook_login 'text to show in button' 'css_class1 css_class2 ... css_classN' %}
...
...
Share content using tags in your templates (you can provide any named args accepted by the Facebook JavaScript SDK).
...
...
{% load facebook %}
...
...
{% facebook_share 'text to show in button' 'css_class1 css_class2 ... css_classN' link="mysite.com" name="This is my site" ... %}
...
...
Request data. The client must be initialized with a profile object.
...
...
from socialnetwork.facebook.clients import FacebookGraph
...
...
graph = FacebookGraph(user.facebookoauthprofile)
data = graph.get('me', params={'fields': 'first_name,last_name,picture.type(normal)'})
data['first_name']
>>> 'John'
Check access token.
graph.debug_access_token()
>>> (True, {'data': {'is_valid':True, 'access_token':...}})
TODO
Provide a method to call a custom setup when the OAuth flow ends.
Extend support for OAuth 2 services (Foursquare, Github, etc.)
Add support for OAuth 1 services (Twitter, LinkedIn, etc.)
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Apache Software License (Apache License (2.0))
- Author: Gabriel González
Classifiers
- Development Status
- Environment
- Framework
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-socialnetwork-0.0.6.tar.gz.
File metadata
- Download URL: django-socialnetwork-0.0.6.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20ccd5916296bb3d975504ce9132d44cb88236be6915c20f0a57374b08a3c89c
|
|
| MD5 |
e257f6a5a2ded869577233eeb5d86135
|
|
| BLAKE2b-256 |
2bb14c323f3f0400d135202030fdf334e172a8c82907c86b852364c1ddc2d9ce
|