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

@@ -20,6 +20,7 @@
<div id="login">
<h1>This is an example of the Authorization Code flow</h1>
<a href="/login" class="btn btn-primary">Log In (Original)</a>
<a href="/test_db" class="btn btn-primary">Test DB</a>
<button id="login-btn">Log In</button>
</div>

View File

@@ -0,0 +1,27 @@
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Test DB Page</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="#">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<ul>
{% for artist in artist_data %}
<li>{{ artist.name }} - {{ artist.num_songs }}</li>
{% endfor %}
</ul>
<pre> {% filter force_escape %} {% debug %} {% endfilter %} </pre>
<script src="http://d3js.org/d3.v3.js"></script>
{% load static %}
<script src="{% static "spotifyvis/scripts/test_db.js" %}"></script>
</body>
</html>

View File

@@ -20,6 +20,6 @@
{% for genre_name, genre_count in genre_dict.items %}
<li>{{ genre_name }} - {{ genre_count }}</li>
{% endfor %}
</ul>
</ul>
</body>
</html>