Dashboard for showing and clustering currently followed albums on spotify.
- nicer cards and layouts via css
- better routing with exception handling
- more than 20 resutls maybe via paging
- searching and filtering
Before you run the image on your computer you need to create a client key at spotify like described in [authentication overview](## authentication overview]
- Run with docker:
docker run -d --name spotidash -p 8000:8000 -e SPOTIFY_CLIENT_ID=<> -e SPOTIFY_SECRET_CLIENT_ID=<> crowdsalat/spotidash
- Or with compose: add the spotify variables in the docker-compose file and run
docker-compose up
You may also want to overwrite the host part of SPOTIFY_CALLBACK_URL. It defaults to localhost:8000/dashboard/albums
This projekt uses gunicorn as WSGI http server. Alternative servers are listed here. To check whether your application is production ready read this article or run python manage.py check --deploy
for a subset of the recommended checks.
To start a gunicorn server which serves the django application run gunicorn config.wsgi
. By default it will be reachable under [http://localhost:8000]. You can run 'gunicorn <project_name>.wsgi
', because the startproject
of django generates a wsgi.py file in the project folder.
This app uses the whitenoise library to serve static files directly via the WSGI Server instead of serving them via a dedicated webserver. In order to work a wrapper was added in the wsgi python file and in the settings.py a middleware was added as well a the variables STATIC_ROOT and STATIC_URL were added. See commit 1ec48f2fa76abcae8a44eb2620eaebfbc58a04e6.
- activate environment:
source env/bin/activate
- start django development server on 8000:
python manage.py runserver
you need:
- python 3
- pip3
- modules defined in requirements.txt
- activate virtualenv
source env/bin/activate
- install new packages via
pip install <packageName>
and afterwards save it in requirements.txtpip3 freeze > requirements.txt
- (optional) install pip3 if not present:
sudo apt-get install python3-pip
- (optional) install virtualenv if not present:
sudo pip3 install virtualenv
(without sudo it wont be on the path) - checkout repo and navigate inside it:
git clone https://github.com/CrowdSalat/spotify-personal-dashboard.git && cd ./spotify-personal-dashboard
(you may want to use ssh git url instead of the given https) - Create virtualenv in root of this repo:
virtualenv env
(env is just the name) - Activate virtualenv:
source env/bin/activate
- Install python packages inside of the virtualenv:
pip3 install -r requirements.txt
steps:
- Create a client key. After creating you need to edit the new client) and add a redirect uri.
- Get new oauth2 access token with the scopes you need.
- The spotify developer dashboard for managing your api keys.
- oauth python clients:
Auth URL: https://accounts.spotify.com/authorize
Access Token URL: https://accounts.spotify.com/api/token
Redirect URI: {{callback_uri}}
Client ID: {{client_id}}
Client Secret: {{client_secret}}
Scope: playlist-read-private playlist-read-collaborative user-library-read user-follow-read user-top-read
Grant Type: Authorization Code
- django was scaffolded with commands:
django-admin startproject config
create django project named configpython manage.py startapp dashboard
create django app inside of django porject named configpython manage.py migrate
created the standard database tables for django. Needed for session.
- django docs:
The project includes a postman project to explore the spotify api. In order to work:
- import the spotify.postman_collection.json and the spotify.postman_environment.json files into postman
- edit the spotify enviroment in postman so it includes your client_id and client_secret see
- under security generate a new oauth2 token and use it.
Full guide from the official postman site explains how to configure a project in order to work with spotify api.