API documentation with examples (https://documenter.getpostman.com/view/23522029/2s9YC4VCwy)
This API provides CRUD operations.
Before you begin, ensure you have met the following requirements:
-a virtual environment
To install and run the API, follow these steps:
- Clone the repository:
git clone https://github.com/shabzynana/stage_two.git
- Navigate to the project directory:
cd stage_two
- Install the dependencies:
pip install -r requirements.txt
- Configure environment variables by creating a .env file in the root directory with the following content:
SECRET_KEY=your_secret_key
DB_NAME=database_name
DB_USER=database_user
DB_PASSWORD=database_password
DB_HOST=database_host
- Start the server:
python manage.py runserver
The API should now be running on http://localhost:8000.
- Endpoint: POST /api
- Description: Create a new person.
- Endpoint: GET /api/:name
- Description: Fetch details of a person by their name.
- Endpoint: PUT /api/:id
- Description: Update details of an existing person by their ID.
- Endpoint: DELETE /api/:id
- Description: delete a person by their ID.
- All request data must be sent in JSON format.
- Include the required fields in the request body.
- All responses are in JSON format.
- Successful responses return a JSON data
- Error responses have a designated error response
The API is live at https://stage-two-d2n3.onrender.com/api
API documentation with examples here
- Author: Adebiyi Oluwafemi