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.
(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
-
Setup virtualenv
virtualenv venv --distribute -
Activate virtualenv:
Mac/Linux:
source venv/bin/activateWindows (you can also just type "go"):
venv\Scripts\activate.bat -
Get the deps:
pip install -r requirements.txt -
Start Flask Server
python main.py -
Test out the app
-
Create the app
heroku create -s cedar -
Deploy the app
git push heroku master -
Open the app in your browser
heroku open
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!
- 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."
