https://github.com/ramusus/django-vkontakte-api
Django implementation for vkontakte API
https://github.com/ramusus/django-vkontakte-api
Last synced: 7 months ago
JSON representation
Django implementation for vkontakte API
- Host: GitHub
- URL: https://github.com/ramusus/django-vkontakte-api
- Owner: ramusus
- License: bsd-3-clause
- Created: 2012-12-20T07:35:47.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2016-05-25T20:58:41.000Z (about 10 years ago)
- Last Synced: 2025-09-10T23:40:51.316Z (11 months ago)
- Language: Python
- Size: 218 KB
- Stars: 15
- Watchers: 7
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Django Vkontakte API
====================
[](http://badge.fury.io/py/django-vkontakte-api) [](https://travis-ci.org/ramusus/django-vkontakte-api) [](https://coveralls.io/r/ramusus/django-vkontakte-api)
Application for interaction with objects of VK API using Django ORM
Installation
------------
pip install django-vkontakte-api
Add into `settings.py` lines:
INSTALLED_APPS = (
...
'vkontakte_api',
)
# oauth-tokens settings
OAUTH_TOKENS_HISTORY = True # to keep in DB expired access tokens
OAUTH_TOKENS_VKONTAKTE_CLIENT_ID = '' # application ID
OAUTH_TOKENS_VKONTAKTE_CLIENT_SECRET = '' # application secret key
OAUTH_TOKENS_VKONTAKTE_SCOPE = ['ads', 'wall' ,'photos', 'friends', 'stats'] # application scopes
OAUTH_TOKENS_VKONTAKTE_USERNAME = '' # user login
OAUTH_TOKENS_VKONTAKTE_PASSWORD = '' # user password
OAUTH_TOKENS_VKONTAKTE_PHONE_END = '' # last 4 digits of user mobile phone
Coverage of API methods
-----------------------
* [resolveScreenName](http://vk.com/dev/resolveScreenName) – Detects a type of object (e.g., user, community, application) and its ID by screen name.
Usage examples
--------------
### Simple API request
>>> from vkontakte_api.api import api_call
>>> api_call('resolveScreenName', **{'screen_name': 'durov'})
{u'object_id': 1, u'type': u'user'}
>>> api_call('users.get', **{'user_ids': 'durov'})
[{'first_name': u'Павел', 'last_name': u'Дуров', 'uid': 1}]