Casting Agency models a company that is responsible for creating movies and managing and assigning actors to those movies.
Hosted on heroku. Link.
This is my capstone project for the Udacity FSWD nanodegree.
All dependencies are listed in the requirements.txt
file.
They can be installed by running pip3 install -r requirements.txt
.
The API has three registered users:
- Assistant
email: assistant@casting.com
password: assistant@casting.com1
- Director
email: director@casting.com
password: director@casting.com1
- Producer
email: producer@casting.com
password: producer@casting.com1
The Auth0 domain and api audience can be found in setup.sh
.
Gets all movies from the db.
Response:
{
"movies": [
{
"id": 1,
"movies": "all acted movies here",
"release_date": "2021-02-02",
"title": "Movie"
},
{
"id": 2,
"movies": "all acted movies here",
"release_date": "2019-01-01",
"title": "New movie"
}
],
"success": true
}
Adds a new movie to the db.
Data:
{
"title": "title",
"release_date": "release_date"
}
Response:
{
'success': true,
'movie': 'title'
}
Edit data on a movie in the db.
Data:
{
"title": "new title",
"release_date": "2021-02-02"
}
Response:
{
'success': true,
'movie': {
"id": 1,
"movies": "all acted movies here",
"release_date": "2021-02-02",
"title": "new title"
}
}
Delete a movie from the db.
Response:
{
'success': true,
'delete': 1
}
Gets all actors from the db.
Response:
{
"actors": [
{
"gender": "M",
"id": 1,
"movies": "all acted movies here",
"name": "actor"
},
{
"gender": "F",
"id": 2,
"movies": "all acted movies here",
"name": "ewwe"
}
],
"success": true
}
Adds a new actor to the db.
Data:
{
"name": "name",
"gender": "F"
}
Response:
{
'success': true,
'actor': 'name'
}
Edit data on a actor in the db.
Data:
{
"name": "new name",
"gender": "M"
}
Response:
{
'success': true,
'actor': {
"gender": "M",
"id": 1,
"movies": "all acted movies here",
"name": "new name"
}
}
Delete a actor from the db.
Response:
{
'success': true,
'delete': 1
}
To run the tests, run python3 tests.py
.