Added documentation for windows users attempting to set environment variables (#822)

This commit is contained in:
Robinson Ibarra 2022-06-18 15:30:07 -07:00 committed by GitHub
parent 36ea3d9319
commit ca73420248
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -5,10 +5,17 @@ If you would like to contribute to spotipy follow these steps:
### Export the needed environment variables ### Export the needed environment variables
```bash ```bash
# Linux or Mac
export SPOTIPY_CLIENT_ID=client_id_here export SPOTIPY_CLIENT_ID=client_id_here
export SPOTIPY_CLIENT_SECRET=client_secret_here export SPOTIPY_CLIENT_SECRET=client_secret_here
export SPOTIPY_CLIENT_USERNAME=client_username_here # This is actually an id not spotify display name export SPOTIPY_CLIENT_USERNAME=client_username_here # This is actually an id not spotify display name
export SPOTIPY_REDIRECT_URI=http://localhost:8080 # Make url is set in app you created to get your ID and SECRET export SPOTIPY_REDIRECT_URI=http://localhost:8080 # Make url is set in app you created to get your ID and SECRET
# Windows
$env:SPOTIPY_CLIENT_ID="client_id_here"
$env:SPOTIPY_CLIENT_SECRET="client_secret_here"
$env:SPOTIPY_CLIENT_USERNAME="client_username_here"
$env:SPOTIPY_REDIRECT_URI="http://localhost:8080"
``` ```
### Create virtual environment, install dependencies, run tests: ### Create virtual environment, install dependencies, run tests:

View File

@ -132,7 +132,7 @@ class SpotifyOAuth that can be used to authenticate requests like so::
print(idx, track['artists'][0]['name'], " ", track['name']) print(idx, track['artists'][0]['name'], " ", track['name'])
or if you are reluctant to immortalize your app credentials in your source code, or if you are reluctant to immortalize your app credentials in your source code,
you can set environment variables like so (use ``SET`` instead of ``export`` you can set environment variables like so (use ``$env:"credentials"`` instead of ``export``
on Windows):: on Windows)::
export SPOTIPY_CLIENT_ID='your-spotify-client-id' export SPOTIPY_CLIENT_ID='your-spotify-client-id'