Authentication not working in a live server | Django, Spotipy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using Django and when I run a local server at localhost:8000, this piece of code works as intended:
spotipy.Spotify( auth_manager=SpotifyOAuth( redirect_uri=config["REDIRECT_URI"], client_id=config["SPOTIPY_CLIENT_ID"], client_secret=config["SPOTIPY_CLIENT_SECRET"], scope="user-library-read user-library-modify playlist-modify-private playlist-modify-public", cache_handler=spotipy.DjangoSessionCacheHandler(request), ) ).current_user()
It redirects me to http://localhost:8080/callback and fetches all the data by itself and caches the received token.
But when I do the same on a live server, it doesn't redirect me and the terminal asks me to input the URL I have been redirected to.
I am running the live server in port 8000 and my redirect_uri's port is 8080.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page