Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gotoariel committed Aug 17, 2015
0 parents commit 6533bab
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn app:app
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Flask on Heroku

This project is intended to help you tie together some important concepts and
technologies from the 12-day course, including Git, Flask, json, pandas,
requests, Heroku, and Bokeh for visualization.

The repository contains a basic template for a Flask configuration that will
work on Heroku.

## Step 1: Setup and deploy
- Git clone the existing template repository.
- `Procfile`, `requirements.txt`, `conda-requirements.txt`, and `runtime.txt`
contain some default settings.
- There is some boilerplate html in `templates/`.
- Create Heroku application with `heroku create <app_name>` or leave blank to
auto-generate a name.
- (Suggested) Use the conda buildpack. If you choose not to, put all requirements
into `requirements.txt`. Question: What are the pros and cons of using Conda
vs. pip?
`heroku config:add BUILDPACK_URL=https://github.com/kennethreitz/conda-buildpack.git`
- Deploy to Heroku: `git push heroku master`
- Take a look with `heroku open`

## Step 2: Get data from API and put it in pandas

## Step 3: Use Bokeh to plot pandas data
14 changes: 14 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from flask import Flask, render_template, request, redirect

app = Flask(__name__)

@app.route('/')
def main():
return redirect('/index')

@app.route('/index')
def index():
return render_template('index.html')

if __name__ == '__main__':
app.run(port=33507)
4 changes: 4 additions & 0 deletions conda-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
scipy
numpy
pandas
bokeh
8 changes: 8 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dill==0.2.1
Flask==0.10.1
gunicorn==19.3.0
Jinja2==2.7.2
oauth==1.0.1
oauthlib==0.7.2
requests>=2.2.1
simplejson==3.8.0
1 change: 1 addition & 0 deletions runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-2.7.10
13 changes: 13 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello, World!</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div>
<h1>Hello, World!</h1>
</div>
</body>
</html>

0 comments on commit 6533bab

Please sign in to comment.