Hello everyone! I have an website that does not display any results when I am running it and I don't know why. On my local laptop it runs perfectly and returns results in few seconds. When I run it on pythonanywhere it only keeps loading until dropping with the error "Something went wrong" and it shows the message 504-loadbalancer. I tried out the methods indicated on other posts, I even gave up at the threads that I had (since I found out the on free account you only have one single worker) but nothing worked out. I am out of ideas. This is a part of my code:
@app.route('/recommend', methods=['POST'])
def recommend():
print('{timestamp} -- request started'.format(timestamp=datetime.utcnow().isoformat()))
first_playlist_url = request.form.getlist('URL')[0]
print('{timestamp} -- request started'.format(timestamp=datetime.utcnow().isoformat()))
second_playlist_url = request.form.getlist('URL')[1]
most_similar_songs = find_most_similar_songs(first_playlist_url, second_playlist_url, sp)
def handle_first_playlist(first_playlist_url, sp):
print("first url: ", first_playlist_url)
first_playlist_uri = first_playlist_url.split('/')[-1]
first_playlist_track_uris_names_popularity = [i for i in functions.collect_track_details(first_playlist_uri, sp)]
print('first_playlist_track_uris_names_popularity ', first_playlist_track_uris_names_popularity)
Can someone help me? I really need some help! Best regards, Cristina