Spy Cat Agency (SCA) Management API
A RESTful API built with Django and Django REST Framework for managing spy cats, missions, and targets for the Spy Cat Agency (SCA). This API enables SCA to handle the full lifecycle of spy cats, assign them to missions, and manage targets efficiently.
Features:
Spy Cats Management:
Add, update, view, and delete spy cats
Retrieve a list of all spy cats or a single cat
Update spy cat salary
Validate cat breed using TheCatAPI
Mission and Target Management:
Create new missions with targets in a single request
Assign a mission to a specific spy cat
Update target notes and mark targets as complete
Mark a mission as complete once all associated targets are complete
Prevent note updates on completed targets or missions
Delete a mission only if it has not been assigned to a cat
Requirements:
Python 3.8+
Django 3.2+
Django REST Framework
PostgreSQL (or any other SQL-like database)
django-filter (for filtering capabilities)
requests (for external breed validation with TheCatAPI)
TheCatAPI key for breed validation
Installation:
- Clone the repository:
git clone https://github.com/yourusername/spy-cat-agency-api.git
cd spy-cat-agency-api
- Create a virtual environment:
source env/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
SECRET_KEY=<your_django_secret_key>
DEBUG=True
DATABASE_URL=postgres://<user>:<password>@localhost:5432/spy_cat_db
THE_CAT_BREED_API_KEY=<your_thecatapi_key>
- Set up the database:
python manage.py migrate
- Create a superuser (optional but recommended for admin access):
python manage.py createsuperuser
- Start the development server:
python manage.py runserver