i trying use spotipy execute search request spotify. specified client id, secret id , redirect url (http://127.0.0.1:8000/callback/q) in bash_profiles, described in api.
def search(username, query): token = util.prompt_for_user_token(username, scope) #like oauth redirect url print("received token response") if token: sp = spotipy.spotify(auth=token) return sp.search(query, 1, 0, type='track')
the problem using django, forces me specify redirect url in urls.py , corresponding view in views.py
[from urls.py...] url(r'^callback/q$', views.callback, name='callback'), [from views.py...] def callback(request): print("callback view reached") return render(request, 'rec/search.html')
it seems django intercepts displays view redirect-url, search method never finishes executing. little confused on how token requires redirect url, yet continue executing rest of method follows authorization request
i'm not sure if helps abandoned authentication via util.prompt_for_user_token in favor of this basic implementation. it's implemented in bottle should relatively easy translate django , specific needs. i'm hoping same.
Comments
Post a Comment