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.
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
$ python manage.py test
$ pipenv run python manage.py runserver
Providing dredd has been installed, you can run the following to run dredd against the Polls API:
$ pipenv run dredd
$ docker-compose up web
$ open "http://$(docker-machine ip default):8080"
$ docker-compose run shell python manage.py test
Click the button below to automatically set up the Polls API in an app running on your Heroku account.
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
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
polls-api is released under the MIT license. See LICENSE.