Skip to main content

Django implementation for Facebook Graph API

Project description

# Django Facebook Graph API

[![PyPI version](https://badge.fury.io/py/django-facebook-api.png)](http://badge.fury.io/py/django-facebook-api) [![Build Status](https://travis-ci.org/ramusus/django-facebook-api.png?branch=master)](https://travis-ci.org/ramusus/django-facebook-api) [![Coverage Status](https://coveralls.io/repos/ramusus/django-facebook-api/badge.png?branch=master)](https://coveralls.io/r/ramusus/django-facebook-api)

Application for interacting with Facebook Graph API objects using Django model interface

## Installation

pip install django-facebook-api

Add into `settings.py` lines:

INSTALLED_APPS = (
...
'oauth_tokens',
'facebook-api',
)

# oauth-tokens settings
OAUTH_TOKENS_HISTORY = True # to keep in DB expired access tokens
OAUTH_TOKENS_FACEBOOK_CLIENT_ID = '' # application ID
OAUTH_TOKENS_FACEBOOK_CLIENT_SECRET = '' # application secret key
OAUTH_TOKENS_FACEBOOK_SCOPE = ['offline_access'] # application scopes
OAUTH_TOKENS_FACEBOOK_USERNAME = '' # user login
OAUTH_TOKENS_FACEBOOK_PASSWORD = '' # user password

## Usage examples

### Simple API Graph request

>>> from facebook_api.api import api_call
>>> api_call('zuck')
Node(<Graph(u'https://graph.facebook.com/zuck') at 0xb1cbfac>,
{'first_name': 'Mark',
'gender': 'male',
'id': '4',
'last_name': 'Zuckerberg',
'link': 'http://www.facebook.com/zuck',
'locale': 'en_US',
'name': 'Mark Zuckerberg',
'updated_time': '2013-03-13T20:36:43+0000',
'username': 'zuck'})

>>> api_call('zuck', fields='id,name')
Node(<Graph(u'https://graph.facebook.com/zuck') at 0xb1d2a8c>,
{'id': '4', 'name': 'Mark Zuckerberg'})

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

django-facebook-api-0.4.3.tar.gz (27.9 kB view details)

Uploaded Source

File details

Details for the file django-facebook-api-0.4.3.tar.gz.

File metadata

File hashes

Hashes for django-facebook-api-0.4.3.tar.gz
Algorithm Hash digest
SHA256 eb2471b2535aaf06baa26ae276134387f28473594024730720c297f62efc57f6
MD5 bffce5584d8454164e4232a2176d942b
BLAKE2b-256 ff93758a9e1a12d4fb98d0da98ce1a1edb93c83ee29636a819b07b546ee9f1d5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page