Skip to content

BruceEckel/Question-Of-The-Day

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Question of the Day

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."

About

For the "clearing" process

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors