ドキュメントの例を試してみると、400エラーが発生します
settings.py
INSTALLED_APPS = (
'oauth_provider',
'django.contrib.auth',
)
OAUTH_SIGNATURE_METHODS = ['hmac-sha1',]
そして私がこれをするとき
>>> from oauth_provider.models import Resource, Consumer
>>> resource = Resource(name='photos', url='/oauth/photo/')
>>> resource.save()
>>> CONSUMER_KEY = 'dpf43f3p2l4k3l03'
>>> CONSUMER_SECRET = 'kd94hf93k423kf44'
>>> consumer = Consumer(key=CONSUMER_KEY, secret=CONSUMER_SECRET,
... name='http://127.0.0.1:9000', user=jane)
>>> consumer.save()
>>> from django.test.client import Client
>>> c = Client()
>>> import time
>>> parameters = {
... 'oauth_consumer_key': CONSUMER_KEY,
... 'oauth_signature_method': 'PLAINTEXT',
... 'oauth_signature': '%s&' % CONSUMER_SECRET,
... 'oauth_timestamp': str(int(time.time())),
... 'oauth_nonce': 'requestnonce',
... 'oauth_version': '1.0',
... 'oauth_callback': 'http://127.0.0.1:9000/request_token_ready',
... 'scope': 'photos',
... }
>>> response = c.get("/oauth/request_token/", parameters)
>>> response.status_code
400
構成に何かが欠けていますか?これを行う方法についての良いドキュメントが見つかりませんか?