Rohith's Blog

I write about tech.

15 Jul 2020

A REST API for managing playlists

So the last 24 hours were spent on a code-sprint and this is the end product. I built a Django REST API for retrieving and updating data to a PostgreSQL database of the backend of a music app that wishes to manage playlists and songs.
You can find the codebase on my github

Playlist Manager

A Django based REST API for managing songs and playlists, along with a graphical management interface

Built using:

Setup Instructions

  1. Create virtual environment using vne/virtualenv/etc using Python3.8
  2. Activate virtual environment in terminal
  3. Install dependencies by running ‘pip install -r requirements.txt’
  4. Run ‘python makemigrations’
  5. Run ‘python migrate’
  6. Run ‘python runserver’. The app should now be running locally at or localhost:8000

Using the app

  1. Go to the Admin Page ( and login as admin with the details below to to create new users/groups/manage database of app.
  2. The admin username is admin and password is testing321
  3. You can either use the Management Interface(after logging in as admin) or teh REST API(after creating a account and logging in) in order to view and update the songs/artists/albums/playlists information.
  4. The Management Interface at can be used to graphically add new users or update the music database of the app. You can use it to add new songs/artists/albums/playlists.
  5. The REST API at can be used to access the app and query its data using GET/POST requests and retrieving/updating data in API/JSON format.
  1. Home Page:
  2. Admin Page:
  3. Register:
  4. Login:
  5. Access Management Interface:
  6. Add/retrieve songs using Management Interface:
  7. Add/retrieve artists using Management Interface:
  8. Add/retrieve albums using Management Interface:
  9. Add/retrieve playlists using Management Interface:
  10. Accessing REST API:
  11. Add/retrieve songs using REST API:
  12. Add/retrieve artists using REST API:
  13. Add/retrieve albums using REST API:
  14. Add/retrieve playlists using REST API:


  • You can send GET requests with or without creating an account and logging in. Although, you have to create an account and be logged in in order to send POST requests.

  • I have included some test data for demonstration’s sake. I hope you appreciate my fine taste for music.

  • I have exported all of the SQL code from all the major migrations that I have made and stored it in /SQL directory in order to maintain database integrity.

  • Set DEBUG = True in of the backend app to view detailed logs and errors messages

If you find any bugs or if you think you can improve this implementation in any manner, please fork and create a pull request!

This is still a work in progress. I plan on dedicating more time for this in the future.

comments powered by Disqus