An open API service indexing awesome lists of open source software.

https://github.com/sernadela/music-app-api

Simple Music API with Django Rest Framework
https://github.com/sernadela/music-app-api

django django-rest-framework music rest-api

Last synced: about 2 months ago
JSON representation

Simple Music API with Django Rest Framework

Awesome Lists containing this project

README

          

# MusicApp API
(Django Rest Framework)

## Documentation

### Run

Create a virtualenv to isolate your package dependencies locally
```
virtualenv env
source env/bin/activate
```

Install project requirements:
```
pip install -r requirements.txt
```

Create DB
```
python manage.py migrate
```

Run Django server at [http://localhost:8000](http://localhost:8000)
```
python manage.py runserver
```

### REST API

**List all songs available:**

```
GET /api/v1/songs/ HTTP/1.1
Content-Type: application/json
```

**Add Song:**

```
POST /api/v1/songs/ HTTP/1.1
Content-Type: application/json

{
"title":"my_song_title",
"artist":"my_song_artist",
"album":"my_song_album"
}

```

**Remove Song:**

```
DELETE /api/v1/songs/ HTTP/1.1
```

**List all users available:**

```
GET /api/v1/users/ HTTP/1.1
Content-Type: application/json
```

**Add Song:**

```
POST /api/v1/users/ HTTP/1.1
Content-Type: application/json

{
"username":"",
"email":""
}

```

**Remove User:**

```
DELETE /api/v1/users/{user_id} HTTP/1.1
```

**Get User Favorite Songs:**

```
GET /api/v1/fav/user/ HTTP/1.1
Content-Type: application/json

```

**Add Favorite Song to User:**

```
POST /api/v1/fav/user//song HTTP/1.1
Content-Type: application/json

{
"id": ""
}

```

**Rm Favorite Song from User:**

```
DELETE /api/v1/fav/user//song/ HTTP/1.1
Content-Type: application/json

```