Capstone manages actors and movies
get:actors
post:actors
patch:actors
delete:actors
get:movies
post:movies
patch:movies
delete:movies
get:actors
- `get:movies`
get:actors
- `post:actors`
- `patch:actors`
- `delete:actors`
- `get:movies`
- `patch:movies`
get:actors
- `get:movies`
- `post:movies`
- `delete:movies`
Test your endpoints with Postman.
User 1 - Casting Assistant
User 2 - Casting Director
User 3 - Executive Producer
Sign into each account and make note of the JWT.
GET https://YOUR_DOMAIN/authorize?
audience=YOUR_AUDIENCE&
response_type=token&
client_id=YOUR_CLIENT_ID&
redirect_uri=https://callbackurl&
$ sudo su postgres
$ psql`
postgres=# CREATE DATABASE capstone;
postgres=# CREATE DATABASE capstone_test;`
postgres=# \q
$ exit
To run the server, execute:
- Then add a .env file as shown in the following sample
source venv/bin/activate
export FLASK_APP="run.py"
export SECRET="some-very-long-string-of-random-characters-CHANGE-TO-YOUR-LIKING"
export APP_SETTINGS="development"
export DATABASE_URL="postgres://mitch:mufasa2019@localhost/capstone"
export TESTDB_URL="postgres://mitch:mufasa2019@localhost/capstone_test"
export AUTH0_DOMAIN="domain.auth0.com"
export API_AUDIENCE="your api audience"
$ virtualenv -p python3 venv
$ pip install -r requirements.txt
$ source .env
$ python manage.py db init
$ python manage.py db migrate
$ exit
$ flask run --reload
$ python test_app.py
localhost:5000
heroku: https://capstone-philip.herokuapp.com/
- Actors body:
{
"name": "Brad Pitt",
"age": 56,
"gender": "Male"
}
{
"actors": [
{
"age": 16,
"gender": "Male",
"id": 56,
"name": "Brad Pitt"
}
],
"success": true
}
{
"actors": [
{
"age": 65,
"gender": "Male",
"id": 2,
"name": "Brad"
},
{
"age": 65,
"gender": "Male",
"id": 1,
"name": "Jim Carrey"
}
],
"success": true
}
{
"actor": {
"age": 65,
"gender": "Male",
"id": 1,
"name": "Jim Carrey"
},
"success": true
}
{
"deleted": 2,
"success": true
}
- Actors body:
```json5
{
"name": "Brad Pitt Jr",
"age": 56,
"gender": "Male"
}
{
"actors": [
{
"age": 16,
"gender": "Male",
"id": 56,
"name": "Brad Pitt Jr"
}
],
"success": true
}
{
"title": "Mad Max",
"release_date": "5-6-2020"
}
{
"movie": [
{
"id": 14,
"release_date": "Sat, 02 Feb 3202 00:00:00 GMT",
"title": "Dark Night"
}
],
"success": true
}
{
"movie": [
{
"id": 14,
"release_date": "Sat, 02 Feb 3202 00:00:00 GMT",
"title": "Dark Night"
},
{
"id": 14,
"release_date": "Sat, 02 Feb 3202 00:00:00 GMT",
"title": "Dark Night"
}
],
"success": true
}
{
"movie": [
{
"id": 14,
"release_date": "Sat, 02 Feb 3202 00:00:00 GMT",
"title": "Dark Night"
}
],
"success": true
}
{
"deleted": 2,
"success": true
}
{
"title": "Mad Max",
"release_date": "5-6-2020"
}
{
"movie": [
{
"id": 14,
"release_date": "Sat, 02 Feb 3202 00:00:00 GMT",
"title": "Dark Night"
}
],
"success": true
}
{
'success': false,
'error': 400,
'message': 'Bad request'
}
{
'success': false,
'error': 404,
'message': 'Resource Not Found'
}
{
'success': false,
'error': 422,
'message': 'Unable to process request'
}
{
'success': false,
'error': 409,
'message': 'Duplicate found'
}
### Internal server error (500)
```json5
{
'success': false,
'error': 500,
'message': 'Internal server error'
}