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
- Host: GitHub
- URL: https://github.com/sernadela/music-app-api
- Owner: sernadela
- License: mit
- Created: 2018-03-24T20:32:37.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-24T20:53:10.000Z (about 8 years ago)
- Last Synced: 2025-04-13T10:02:21.822Z (about 1 year ago)
- Topics: django, django-rest-framework, music, rest-api
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```