Skip to content

Getting Started with API

Drew Winstel edited this page Jun 9, 2019 · 2 revisions

Getting Started with APIS

Prerequisites

Linux

Install these packages from your distribution's package manager

  • docker
  • docker-compose
  • python 3.7
  • pipenv

Windows

The devs have run into all sorts of weirdness running inside Docker for Windows.

Avoid this if you can.

macOS

Install Docker Desktop for Mac.

Install Homebrew and install these packages:

  • pipenv

Install the latest 64-bit macOS Installer of Python 3.7 from python.org.

Installing dependencies

  1. Clone the repository.
  2. Run from the terminal: pipenv install --dev
  3. Run tests to make sure everything works:
    docker-compose run --rm web pipenv run ./manage.py test
  4. Run the API:
    docker-compose up
  5. Make sure you can access the API by going to http://localhost:8000/api/v1/beers/

Loading fixtures

Seed your database with important values:

docker-compose run --rm web ./manage.py loaddata */fixtures/*.json
Clone this wiki locally