Write a Flask / FastAPI/ Django Web API that simulates the behavior of an audio file server while using a MongoDB / SQL database.
Requirements: You have one of three audio files which structures are defined below Audio file type can be one of the following:
1 – Song 2 – Podcast 3 – Audiobook
ID – (mandatory, integer, unique)
Name of the song – (mandatory, string, cannot be larger than 100 characters)
Duration in number of seconds – (mandatory, integer, positive)
Uploaded time – (mandatory, Datetime, cannot be in the past)
ID – (mandatory, integer, unique)
Name of the podcast – (mandatory, string, cannot be larger than 100 characters)
Duration in number of seconds – (mandatory, integer, positive)
Uploaded time – (mandatory, Datetime, cannot be in the past)
Host – (mandatory, string, cannot be larger than 100 characters)
Participants – (optional, list of strings, each string cannot be larger than 100 characters, maximum of 10 participants possible)
ID – (mandatory, integer, unique)
Title of the audiobook – (mandatory, string, cannot be larger than 100 characters)
Author of the title (mandatory, string, cannot be larger than 100 characters)
Narrator - (mandatory, string, cannot be larger than 100 characters)
Duration in number of seconds – (mandatory, integer, positive)
Uploaded time – (mandatory, Datetime, cannot be in the past)
1: pip install pipenv
2: pipenv install django
3: pipenv install djangorestframework django-cors-headers
4: pipenv install django-mysql
pipenv shell
1. python manage.py makemigrations
2. python manage.py migrate
python manage.py runserver
python manage.py test