Django Web API that simulates the behavior of an audio file server while using a SQL database.
-
Install using
pip install -r requirements.txt. -
run
django-admin migrate -
run
python manage.py runserveraccording to your enviorment.
- POST http://127.0.0.1:8000/api/audio/create
- GET http://127.0.0.1:8000/api/audio/song/
- GET,DELETE,PUT http://127.0.0.1:8000/api/audio/song/1
- GET http://127.0.0.1:8000/api/audio/podcast/
- GET,DELETE,PUT http://127.0.0.1:8000/api/audio/podcast/1
- GET http://127.0.0.1:8000/api/audio/audiobook/
- GET,DELETE,PUT http://127.0.0.1:8000/api/audio/audiobook/1
Content-Type: multipart/form-data;
Example: of Song Data send through formData { "audioFileType": "song", "audioFileMetadata" : { "name": "test name", "duration": "300" }, audioFile: test.mp3 } Example of podcast Data send through formData
{ "audioFileType": "podcast", "audioFileMetadata": { "name": "test.mp3", "duration": "400", "host": "hostname", "participants": "john,undertaker" }, audioFile: test.mp3 } Example of audiobook Data send through formData { "audioFileType": "audiobook", "audioFileMetadata": { "title": "title", "author": "author name", "duration": "400", "narrator": "narrator name" }, audioFile: test.mp3 }
( These fields sends through formData audioFileType,audioFileMetadata,audioFile and mandatary Fields )
Please make media/audio folder inside filedtest/filedProject.