[GH-ISSUE #61] Authorisation with Heroku #31

Closed
opened 2026-02-27 23:20:29 +03:00 by kerem · 2 comments
Owner

Originally created by @issyrichards on GitHub (Jul 18, 2015).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/61

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

Originally created by @issyrichards on GitHub (Jul 18, 2015). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/61 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
kerem 2026-02-27 23:20:29 +03:00
Author
Owner

@arska commented on GitHub (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
<!-- gh-comment-id:161950475 --> @arska commented on GitHub (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
Author
Owner

@stephanebruckert commented on GitHub (Jun 14, 2020):

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

<!-- gh-comment-id:643794957 --> @stephanebruckert commented on GitHub (Jun 14, 2020): Follow this example to use spotipy in an API https://github.com/plamere/spotipy/blob/master/examples/app.py
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#31
No description provided.