Adds DjangoAuth backend and Accesstoken model, misc fixes
This commit is contained in:
1 parent
edf1416405
commit
ce403701eb
5 files changed
+85
-24
No files matched your search
+11
-2
@@ -3,12 +3,18 @@ import json
|
||||
|
||||
import pydusken
|
||||
|
||||
# oauth
|
||||
client_id = "d802768a8afd9dec2660"
|
||||
client_secret = "3962467fe60a94727812053c8a4f44533f4ef610"
|
||||
|
||||
# credentials
|
||||
username = "admin"
|
||||
password = "admin"
|
||||
|
||||
# setup client
|
||||
client = pydusken.DuskenApi(username=username, password=password)
|
||||
client = pydusken.DuskenApi(client_id, client_secret)
|
||||
|
||||
client.authenticate(username, password)
|
||||
|
||||
# get member
|
||||
pprint.pprint(client.members.get('1'))
|
||||
@@ -17,4 +23,7 @@ pprint.pprint(client.members.get('1'))
|
||||
pprint.pprint(client.members.get_groups('1'))
|
||||
|
||||
# update member password to the same password as you have
|
||||
pprint.pprint(client.members.update('1', password='admin'))
|
||||
pprint.pprint(client.members.update('1', address='admin'))
|
||||
|
||||
# filter members
|
||||
pprint.pprint(client.members.filter(email="nikolai@studentersamfundet.no"))
|
||||
Reference in new issue
Block a user