No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 564 additions and 108 deletions
-
2.gitignore
-
10api/management/commands/update-history.py
-
30api/models.py
-
8api/urls.py
-
178api/utils.py
-
139api/views.py
-
12graphs/templates/graphs/genre_graph.html
-
3graphs/templates/graphs/logged_in.html
-
17graphs/templates/graphs/user_history.html
-
1graphs/urls.py
-
16graphs/utils.py
-
54graphs/views.py
-
8login/forms.py
-
5login/models.py
-
2login/templates/login/index.html
-
10login/templates/login/scan.html
-
1login/urls.py
-
73login/utils.py
-
80login/views.py
-
4requirements.txt
-
5spotifyvis/settings.py
-
13static/css/dark_bg.css
-
1update-history.sh
@ -0,0 +1,10 @@ |
|||
from django.core.management.base import BaseCommand, CommandError |
|||
from api.utils import parse_history |
|||
from login.models import User |
|||
|
|||
class Command(BaseCommand): |
|||
help = 'Update history for users who requested it' |
|||
|
|||
def handle(self, *args, **options): |
|||
user_id = "polarbier" |
|||
parse_history(User.objects.get(id=user_id).secret) |
@ -0,0 +1,17 @@ |
|||
<!DOCTYPE html> |
|||
{% load static %} |
|||
{% load render_table export_url from django_tables2 %} |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<title>User History</title> |
|||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> |
|||
<link rel="stylesheet" href="{% static 'css/dark_bg.css' %}"> |
|||
</head> |
|||
<body> |
|||
<h1>{{ user_id }}'s Listening History</h1> |
|||
<p> Found {{ total_history }} songs. </p> |
|||
<a class="btn btn-primary " href="{% export_url 'csv' %}" role="button">Export</a> |
|||
{% render_table user_history_table %} |
|||
</body> |
|||
</html> |
@ -0,0 +1,8 @@ |
|||
from django import forms |
|||
from .models import HistoryUpload |
|||
|
|||
class HistoryUploadForm(forms.ModelForm): |
|||
class Meta: |
|||
model = HistoryUpload |
|||
fields = ('user', 'document', ) |
|||
widgets = { 'user': forms.HiddenInput() } |
@ -1,8 +1,15 @@ |
|||
body { |
|||
background-color: #1e1e1e; |
|||
/* dark grey */ |
|||
background-color: #1e1e1e; |
|||
} |
|||
|
|||
h1,p { |
|||
color: grey; |
|||
h1,th { |
|||
/* light grey */ |
|||
color: #cccccc; |
|||
} |
|||
|
|||
p,td { |
|||
/* light-dark grey */ |
|||
color: #b2b2b2; |
|||
} |
|||
|
@ -0,0 +1 @@ |
|||
/home/kevin/coding/spotify-lib-vis/bin/python /home/kevin/coding/spotify-lib-vis/src/manage.py update-history >> /home/kevin/coding/spotify-lib-vis/src/api/management/commands/update-history.log |
Write
Preview
Loading…
Cancel
Save
Reference in new issue