Where do I go to set CLIENT_ID and CLIENT_SECRET so it's not stored in my python script? The Spotipy documentation says the following, but I can't figure out where I need to go to input these environment variables. Where do I set os.getenv?
if not client_id:
client_id = os.getenv('SPOTIPY_CLIENT_ID')
if not client_secret:
client_secret = os.getenv('SPOTIPY_CLIENT_SECRET')
if not client_id:
raise SpotifyOauthError('No client id')
if not client_secret:
raise SpotifyOauthError('No client secret')
On windows you can set your enviroment variables openning your cmd, change your directory to where your .py file is saved using
cd C:\example\example
then useSET SPOTIPY_CLIENT_ID=clientIDhere
andSET SPOTIPY_CLIENT_SECRET=secretHere
to set your variables.That depends on what environment you're running in. Environmental variables are variables provided by the operating system, sitting outside the process you're calling them from. If you're in Linux, you would run something like:
You can get more info on environmental variables on Wikipedia.