Graphs and tables for your Spotify account.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

  1. # imports {{{ #
  2. import math
  3. import random
  4. import requests
  5. import os
  6. import urllib
  7. import secrets
  8. import pprint
  9. import string
  10. from datetime import datetime
  11. from django.shortcuts import render, redirect
  12. from .utils import *
  13. # }}} imports #
  14. def display_artist_graph(request, user_secret):
  15. """Renders the artist data graph display page
  16. :param request: the HTTP request
  17. :param user_secret: the user secret used for identification
  18. :return: render the artist data graph display page
  19. """
  20. return render(request, "graphs/artist_graph.html",
  21. get_secret_context(user_secret))
  22. def display_genre_graph(request, user_secret):
  23. return render(request, "graphs/genre_graph.html",
  24. get_secret_context(user_secret))
  25. def display_features_graphs(request, user_secret):
  26. """Renders the audio features page
  27. :param request: the HTTP request
  28. :param user_secret: user secret used for identification
  29. :return: renders the audio features page
  30. """
  31. return render(request, "graphs/features_graphs.html",
  32. get_secret_context(user_secret))