Cat Picture API is a RESTful API for uploading and managing cat pictures in png/jpeg file formats. It allows you to perform various operations, including uploading, deleting, updating, and fetching cat pictures. This API is built using Django and Django REST framework.
Before you begin, ensure you have met the following requirements:
- Python 3.11.5 installed
- Pip package manager installed
- Virtual environment
-
Clone the repository:
git clone https://github.com/Baldev-P/catpictureapi.git
-
Navigate to the project directory:
cd catpictureapi
-
Create a virtual environment :
python3.11 -m venv venv
-
Activate the virtual environment :
On Windows:
.\venv\Scripts\activate
On macOS and Linux:
source venv/bin/activate
-
Install the project dependencies:
pip install -r requirements.txt
-
Apply database migrations:
python manage.py makemigrations python manage.py migrate
-
Run the development server:
python manage.py runserver
-
The API should now be accessible at http://127.0.0.1:8000/.
-
Navigate to API documentation at http://127.0.0.1:8000/swagger/ for details.
You can use this API to perform various operations on cat pictures, such as uploading new cat pictures, fetching cat pictures, updating cat pictures, and deleting cat pictures.
GET v1/catpictures/: Fetch a list of all cat pictures or create a new cat picture.
POST v1/catpictures/create: Create a new cat picture.
GET v1/catpictures/{cat_picture_id}: Retrieve details of a specific cat picture by its ID.
PUT v1/catpictures/{cat_picture_id}: Update a specific cat picture by its ID.
DELETE v1/catpictures/{cat_picture_id}: Delete a specific cat picture by its ID.
For detailed documentation on how to use each endpoint, refer to the API documentation.
To run the test suite for this project, you can use Django's test runner. In the project directory, run the following command:
python manage.py test
Contributions are welcome! Feel free to open issues or pull requests to improve this project.
This project is licensed under the MIT License.