I am running python and flask, when it starts to run I encounter this error message image of error message I have looked at other forums of people encoutering the same error to no avail
#here is the code
'''
from flask import Flask, request, url_for, session, redirect
import spotipy
from spotipy.oauth2 import SpotifyOAuth
app = Flask(__name__)
app.secret_key = ""
app.config['SESSION_COOKIE_NAME'] = 'Spotify cookie'
@app.route('/')
def login():
sp_oauth = create_spotify_oauth()
auth_url = sp_oauth.get_authorize_url()
return redirect(auth_url)
@app.route('/redirect')
def redirectPage():
return 'redirect'
@app.route('/getTracks')
def getTracks():
return 'PAIN'
def create_spotify_oauth():
return SpotifyOAuth(
client_id="",
client_secret="",
redirect_uri=url_for('redirectPage', _external=True),
scope="user-library-read")
i have added the redirect URIs to the settings in spotify for developers image of redirect URIs added, I have pressed save i am expecting this to pop up image of spotify Oauth pop up
Looks like you have a typo in the Redirect URI, in the one being sent to Spotify it is
Note the spelling of redirect, from the Screenshot from the Spotify Dashboard this is "redierect" and also the lack of a forward slash on the one being passed to Spotify as this has to match exactly also so you just need to add that URI to the Spotify Dashboard as is as the URL needs to be exactly correct for it not to show that error for the Invalid Redirect URI so add this one to see if it works