Skip to content

Polls is an example web API that allows consumers to view polls and vote in them.

License

Notifications You must be signed in to change notification settings

IwanJaya/polls-api

 
 

Repository files navigation

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 pip and virtualenv installed.

$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python manage.py migrate

Running the tests

$ python manage.py test

Running the development server

$ python manage.py runserver

Running dredd

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

$ ./scripts/dredd

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.

Requirements:

Heroku Docker plugin

heroku plugins:install heroku-docker`

Running the development server in Docker

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

Running tests in Docker

docker-compose run shell python manage.py test

Release new version to Heroku

heroku docker:release

License

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

About

Polls is an example web API that allows consumers to view polls and vote in them.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 78.3%
  • API Blueprint 19.2%
  • Shell 2.5%