Question of the Day
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:
If this gives you an error message, run:
pip install virtualenv
virtualenv venv --distribute
Windows (you can also just type "go"):
Get the deps:
pip install -r requirements.txt
Start Flask Server
Test out the app
Run on Heroku
Create the app
heroku create -s cedar
Deploy the app
git push heroku master
Open the app in your browser
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."