API Base URL: https://serene-inlet-28321.herokuapp.com/api
method | endpoint | purpose |
---|---|---|
GET | /people | Get all people |
POST | /people | Create a person |
GET | /people/{id} | Get a person |
PUT | /people/{id} | Edit a person |
DELETE | /people/{id} | Remove a person |
Note: The API returns JSON objects.
The page layout is as follows...
- Index - lists all people
- Detail - person detail page
- New - form to create a person
- Edit - form to edit a person
All communication with the database is handled by the API. The Django web client makes requests to the API via service objects called by the views, which then render their specified template once JSON is returned. I separated the business logic and the request logic, so that the app would be more flexible to API changes in the future.