Skip to content

ijif/Flask-Portfolio-Site

Repository files navigation

How to deploy Flask to Heroku

  • Running Python 3.6 🐍
  • Access to a Postgres Database 📘
  • Static Files management with WhiteNoise 🔌

Summary of steps to deploy your app

(Assuming you've already created an account with Heroku)

1. Clone the repo
$ git clone *Cloned Repo && cd *Nme of repo
2. Login to Heroku
$ heroku login
3. Create your Heroku apps
$ heroku create
4. Set the Python Path
$ heroku config:set PYTHONPATH=flask_heroku_example
5. Add Postgres Add-on to your Heroku app

(Use Heroku's site to add Postgres. It's free)

6. Initialize the Database
$ # Create the initial schema
$ heroku pg:psql < schema.sql
$ # Load some initial testing data
$ heroku pg:psql < initial_data.sql
7. Deploy & Profit
$ git push heroku master

Running the app locally

(You need to have installed Postgres locally to run the app. For a simpler sqlite alternative, please check the aforementioned tutorial)

# Create the virtualenv
$ mkvirtualenv *repo
# Install dependencies
$ pip install -r requirements.txt
# Run the app
$ python *repo/main.py
# Now point your browser to localhost:5000

About

My portfolio site built with the Flask framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published