assets_mvp1_demo.mov
- Create a Spotify app at the Spotify Developer Dashboard → Create app.
- Configure Redirect URI (Settings → Redirect URIs):
- Add exactly:
http://127.0.0.1:8501 - Do not use
http://localhost:8501— Spotify does not allowlocalhostfor redirect URIs (redirect URI docs). - Save changes in the dashboard.
- Add exactly:
- Copy credentials from the app Settings page into
.env:
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
SPOTIFY_REDIRECT_URI=http://127.0.0.1:8501(SPOTIFY_REDIRECT_URI is optional if left at the default above.)
- Run the app (
streamlit run app.py), open the UI, and click Connect Spotify. After login, Spotify redirects tohttp://127.0.0.1:8501?code=...(same Streamlit server even if you browsed vialocalhost:8501).
redirect_uri: Not matching configuration— The redirect URI in the authorize URL must match the dashboard exactly. Usehttp://127.0.0.1:8501, notlocalhost. Confirm the URI is saved in Dashboard → Settings → Redirect URIs, then restart Streamlit after editing.env.- The UI shows the active redirect URI under the Connect Spotify button for verification.
MIT