For the "clearing" process
HTML Python Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
static Apple Icon Feb 25, 2015
templates
.gitignore remove pyc files Feb 25, 2015
DailyQuestions.py Added two questions from group phone call. Mar 11, 2015
Procfile
README.md
go.bat
main.py
requirements.txt

README.md

Question of the Day

The App

Creative Commons License
Question of the Day by https://github.com/BruceEckel/Question-Of-The-Day/ is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Getting Started with Python on Heroku

(Adapted from https://github.com/jamesward/hello-python-flask)

First, make sure you have the latest version of pip:

	python -m pip install -U pip

Next, make sure you have virtualenv installed:

	virtualenv --version

If this gives you an error message, run:

	pip install virtualenv

Run Locally

  1. Setup virtualenv

     virtualenv venv --distribute
    
  2. Activate virtualenv:

    Mac/Linux:

     source venv/bin/activate
    

    Windows (you can also just type "go"):

     venv\Scripts\activate.bat
    
  3. Get the deps:

     pip install -r requirements.txt
    
  4. Start Flask Server

     python main.py
    
  5. Test out the app

    http://localhost:5000

Run on Heroku

  1. Create the app

     heroku create -s cedar
    
  2. Deploy the app

     git push heroku master
    
  3. Open the app in your browser

     heroku open
    

Nicer alternative:

Log onto Heroku.com, then follow the instructions to connect to your github repository and launch your app. This can include auto-deployment every time you update your Github repository!

Notes

  • When you change main.py, Flask's automatic refresh doesn't work. You have to kill it and restart it to see the results. The refresh only seems to work on templates.
  • On Android, open the url https://question-of-the-day.herokuapp.com/ in your browser, then from the browser menu choose "Add to home screen." This will add an icon for the app to your device home screen.
  • On iOS (iPhone, iPad) you must use Safari to get an icon on the home screen. Open https://question-of-the-day.herokuapp.com/ in Safari, then select the box with the arrow coming out of it, then choose "add to home screen."