Git Product home page Git Product logo

polls-api's Introduction

Polls API

Apiary Documentation Circle CI Status

This is a Python implementation of a Polls API, an API that allows consumers to view polls and vote in them. Take a look at the API Documentation. We've deployed an instance of this API for testing.

Development Environment

You can configure a development environment with the following:

NOTE: These steps assume you have Python along with pipenv installed.

$ pipenv install
$ pipenv run python manage.py migrate

Running the tests

$ python manage.py test

Running the development server

$ pipenv run python manage.py runserver

Running dredd

Providing dredd has been installed, you can run the following to run dredd against the Polls API:

$ pipenv run dredd

Running via docker

Running the development server

$ docker-compose up web
$ open "http://$(docker-machine ip default):8080"

Running tests in Docker

$ docker-compose run shell python manage.py test

Deploying

Deploying on Heroku

Click the button below to automatically set up the Polls API in an app running on your Heroku account.

Deploy to Heroku

Once you've deployed, you can easily clone the application and alter the configuration to disable features:

$ heroku clone -a new-app-name
$ heroku config:set POLLS_CAN_VOTE_QUESTION=false
$ heroku config:set POLLS_CAN_CREATE_QUESTION=false
$ heroku config:set POLLS_CAN_DELETE_QUESTION=false

Deploying on Heroku using Docker

If you'd like to, you may use Docker on Heroku instead. Refer to the Heroku Container Registry and Runtime Guide for detailed instructions. Providing you have Docker installed you can follow the following steps:

$ heroku container:login
$ heroku container:push web
$ heroku container:release web

License

polls-api is released under the MIT license. See LICENSE.

polls-api's People

Contributors

kylef avatar pksunkara avatar honzajavorek avatar abtris avatar fosrias avatar w-vi avatar zdne avatar dependabot[bot] avatar klokane avatar

Watchers

James Cloos 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.