This is a simple web service for managing vehicle data. It provides CRUD-style API access to a database of vehicles. Each vehicle is uniquely identified by its VIN (Vehicle Identification Number) and includes attributes such as manufacturer, model year, description, and more.
The service is implemented in Django using Django REST Framework (DRF) and supports the following operations:
- Listing all vehicles (GET)
- Creating a new vehicle (POST)
- Retrieving a specific vehicle by VIN (GET)
- Updating an existing vehicle (PUT)
- Deleting a vehicle (DELETE)
- Python 3.8+
- pip (Python package manager)
- SQLite (default) or PostgreSQL (optional)
- Clone the repository:
git clone https://github.com/kimberlyyliuu/apollo-superday.git cd apollo_project cd vehicle_app
- Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate - Install the dependencies:
pip install -r requirements.txt
- Database Setup
python manage.py makemigrations
python manage.py migrate
- Run the development server
python manage.py runserverIf "Error: That port is already in use" Run:
sudo lsof -t -i tcp:8000 | xargs kill -9
Then run:
python manage.py runserver
Run unit tests to ensure all functionality works as expected:
python manage.py test vehicle_app.tests