Giter Site home page Giter Site logo

axelrod-api's Introduction

Axelrod API

A RESTful API for the Axelrod-Python library using Django and the Django Rest Framework.

Getting Started

First create a .env file in the root directory that contains necessary environment variables:

# python/django
PYTHONUNBUFFERED=1
DJANGO_SETTINGS_MODULE=api.config.settings
SECRET_KEY=**Django Secret Key**
DEBUG=True

# database
DATABASE_URL=postgres://postgres@db/postgres

To run this project, you will need to install Docker on your machine. Once Docker is installed and running and your .env file is defined, enter the following command from within the project folder to start the web and database servers:

docker volume create --name=postgres
docker-compose up

This will take several minutes the first time you run it as it needs to download and install all the necessary components into a docker container.

If successful, you should see the following messages at the end of the installation and configuration:

web_1  | Django version 1.11, using settings 'api.config.settings'
web_1  | Starting development server at http://0.0.0.0:8000/
web_1  | Quit the server with CONTROL-C.

and you can view the browseable API in your browser at http://localhost:8000

On OS X, you may need to use the IP address of your docker virtual machine rather then 'localhost' To find that address, use the following command:

docker-machine ip default

If you installed the Kitematic tool, you should also see your new containers in its list and you can start and stop them from there rather than the command line from now on.

Running Tests

python manage.py test --settings=api.config.test_settings

With coverage:

coverage run --source='api' manage.py test --settings=api.config.test_settings
coverage html --omit="*/test*"

axelrod-api's People

Contributors

erik-sn avatar meatballs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.