Trying to pass artist data from db to frontend

This commit is contained in:
2018-06-07 21:48:38 -04:00
parent 62cc6c8ccd
commit 79aedc655d
7 changed files with 100 additions and 10 deletions

View File

@@ -0,0 +1,11 @@
console.log("{{ user_id }}");
artist_data = JSON.parse('{{ artist_data }}');
artist_data.forEach(function(d) {
console.log(d.name, d.num_songs);
});
d3.json("{% url "get_artist_data" user_id %}", function(error, data) {
data.forEach(function(d) {
console.log(d.name, d.num_songs);
});
});