A RESTful API for gathering a collection of Magic: The Gathering cards.
Returns a list of all magic cards in the collection.
Returns the card with the specified name.
Returns cards whose mana cost contains any of the specified colors.
Creates a new magic card.
Request Body:
{
"name": "Card Name",
"current_value": 10.99,
"description": "Card description",
"image_url": "https://example.com/card-image.jpg",
"mana_cost": "2UU"
}
Updates the card with the specified ID.
Request Body:
{
"name": "New Card Name",
"current_value": 11.99,
"description": "New card description",
"image_url": "https://example.com/new-card-image.jpg",
"mana_cost": "3UU"
}
Deletes the card with the specified ID.
- Install the required dependencies using pip:
pip install -r requirements.txt
- Run the migrations to create the database tables:
python manage.py migrate
- Start the development server:
python manage.py runserver
- Use a tool like curl or Postman to test the API endpoints.
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.