forked from thedataincubator/flask-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6533bab
Showing
7 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: gunicorn app:app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
scipy | ||
numpy | ||
pandas | ||
bokeh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python-2.7.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |