Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorisation with Heroku #61

Closed
issyrichards opened this issue Jul 18, 2015 · 2 comments
Closed

Authorisation with Heroku #61

issyrichards opened this issue Jul 18, 2015 · 2 comments

Comments

@issyrichards
Copy link

Hi there,

I have built an app locally using spotipy (thanks for your awesome code!) and I'm trying to push it online with Heroku. I use the util.prompt_for_user_token() function to authorise the user_playlist_create function. Since the util function requires a command line raw input I can't understand how it will work when I push it online - can you a suggest a way that I can by pass this problem?

Many thanks!

Issy

@arska
Copy link
Contributor

arska commented Dec 4, 2015

I had the same problem in https://github.com/arska/srf2spotify#usage:

  1. run locally once to do the authentication
  2. copy the contents of .cache-spotifyusername into a config variable and a local .env file for testing, e.g. SPOTIPY_CACHE='{"access_token": ...}'
  3. create a small launch script that does:
    #!/bin/sh
    echo $SPOTIPY_CACHE > .cache-spotifyusername
    python yourapp.py

@stephanebruckert
Copy link
Member

Follow this example to use spotipy in an API https://github.com/plamere/spotipy/blob/master/examples/app.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants