Last active
January 3, 2016 11:49
-
-
Save alexandre/8459107 to your computer and use it in GitHub Desktop.
Função para retornar músicas disponiveis em um music stream...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#retorna para a pagina com as musicas disponiveis | |
@app.route('/musics/') | |
def avaliable_songs(): | |
#home dev | |
#file_path = "${HOME}/Workspace/flask/musicstream/app/static/uploads" | |
# | |
file_path = "%HOME%\\Dropbox\\GitHub\\musicstream\\app\static\\uploads" | |
file_list = list() | |
for (path, dirs, file) in os.walk(file_path): | |
file_list += file | |
return render_template('avaliable_songs.html', songs=file_list) | |
@app.rout('/musics/<song>') | |
def play(song): | |
''' | |
mesmo informando no url_for da pagina html, a função não | |
''' | |
return render_template('avaliable_songs.html',filename=song) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment