skip to navigation
skip to content

Not Logged In

api-proxy 0.1.3

Thin layer to access resources living behind api's

  • Compliant with django's session authentication and csrf protection.
  • Inspired by django-rest-framework GenericView's enforced url.

Install

pip install api-proxy

Create a login proxy

import api_proxy as proxy

class Login(proxy.BaseProxy):
    url = '/login/'

login = Login()
login.post({'username': 'user', 'password': 'pass'})
print login.result.status_code
print login.result.json()

Create a resource proxy

class UserAccounts(proxy.ResourceProxy):
    url = '/users/'
    detail = '{username}'

users = User(session_source=login)
users.post({'username': 'nedstark', 'password': '123'})
users.rebase(username="nedstark").get()
print users.result.json()
 
File Type Py Version Uploaded on Size
api-proxy-0.1.3.tar.gz (md5) Source 2014-01-23 2KB
  • Downloads (All Versions):
  • 18 downloads in the last day
  • 340 downloads in the last week
  • 1225 downloads in the last month