0
私はPythonとdjangoの初心者です。 Dropboxで動作するようにdjangoを設定しようとしても、エラーが発生する "BadRequestException 'オブジェクトに' get '属性がありません。ここに私のコードです。エラー 'BadRequestException'オブジェクトには属性 'get'がありません
def get_dropbox_auth_flow(web_app_session):
APP_KEY= '****'
APP_SECRET = '****'
redirect_uri = "http://localhost:8000/dropbox"
return DropboxOAuth2Flow(APP_KEY, APP_SECRET, redirect_uri, web_app_session, "dropbox-auth-csrf-token")
# URL handler for /dropbox-auth-start
def dropbox_auth_start(request):
authorize_url = get_dropbox_auth_flow(request.session).start()
return HttpResponseRedirect(authorize_url)
# URL handler for /dropbox-auth-finish
def dropbox_auth_finish(request):
try:
access_token, user_id, url_state = get_dropbox_auth_flow(request.session).finish(request.GET)
# oauth_result = get_dropbox_auth_flow(request.session).finish(request.query_params)
except oauth.BadRequestException as e:
return e
except oauth.BadStateException as e:
# Start the auth flow again.
return HttpResponseRedirect("http://localhost:8000/dropbox_auth_start")
except oauth.CsrfException as e:
return HttpResponseForbidden()
except oauth.NotApprovedException as e:
raise e
except oauth.ProviderException as e:
raise e
私は、あなたは、raise e
を他のすべての例外についてはドキュメントhere
追加トレースバックhere
おそらく 'request.get()'を意味していましたか?これは関数呼び出しなので、括弧が必要です。 – pault
あなたの質問に完全なトレースバックを含めてください。 – Galen
@Galenは私の元の質問でトレースバックを追加しました –