mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 08:35:49 +03:00
[GH-ISSUE #924] Using Flask, RuntimeError: Working outside of request context. #553
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#553
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Andrew3212 on GitHub (Dec 31, 2022).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/924
Trying to allow other people to get their current playing song with a Discord bot
Tried using this flask example below
https://github.com/spotipy-dev/spotipy/blob/master/examples/app.py
this is my code
but i keep getting this error
@stephanebruckert commented on GitHub (Dec 31, 2022):
Do you know at what line the error is raised? This might be flask-related, not spotipy
@Andrew3212 commented on GitHub (Dec 31, 2022):
if not auth_manager.validate_token(cache_handler.get_cached_token()):I've never used flask before so i'm not sure whats wrong.
@stephanebruckert commented on GitHub (Dec 31, 2022):
Would you have a complete stack trace?
@Andrew3212 commented on GitHub (Dec 31, 2022):
I went back and tested it and whenever this third line is called it gives the error
@stephanebruckert commented on GitHub (Dec 31, 2022):
Okay I'm not sure to be honest.
Have you tried running the example as it is in https://github.com/spotipy-dev/spotipy/blob/master/examples/app.py and does it work? I've just tried it again and it works for me.
I don't know your full code, what steps you took and whether the lines you added have an impact:
Have you checked if any of the answers here help? https://stackoverflow.com/q/9931738/1515819
@Andrew3212 commented on GitHub (Dec 31, 2022):
I figured it out. Had to run flask on a different thread and had to switch ports as well.
Sorry about that, and thanks.