Sample Python app for learning CI. You will get a flexible dice on demand!
This application is written in Python and uses Flask as the web framework. It serves a single HTML page.
Gunicorn is used for the production server.
Continous Integration is managed using Travis-CI
Continous Deployment is managed using Heroku
- Clone this repo
- Navigate to the directory
- Execute this:
# This will create and activate a virtualenv. Using a virtual environment allows you to manage your project’s dependencies without messing with system-level files shared by all applications.
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# or if you're still using python 2
pip3 install -r requirements.txt
Now that all dependencies are installed, we can run the program!
- To test the app:
python3 -m pytest -v tests/test_dice.py
- To run the app:
flask run
- Go to the URL provided by the app (i.e.
http://localhost:5000
)
- First off, enter the number of sides of your dice. (Some games might require you to use 20-sided dice)
- Now, click on the
roll
button! - You should see a message on the screen - "You Rolled a ..."
- That's it!