Initial commit of app
This commit is contained in:
parent
8a6bf57cef
commit
7affb6db3d
8 changed files with 11870 additions and 89 deletions
2
src/templates/enthusiast.html
Normal file
2
src/templates/enthusiast.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
{% extends "layout.html" %}
|
||||
{% set active_page = "enthusiast" %}
|
||||
2
src/templates/index.html
Normal file
2
src/templates/index.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
{% extends "layout.html" %}
|
||||
{% set active_page = "index" %}
|
||||
2
src/templates/investor.html
Normal file
2
src/templates/investor.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
{% extends "layout.html" %}
|
||||
{% set active_page = "investor" %}
|
||||
40
src/templates/layout.html
Normal file
40
src/templates/layout.html
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{ title }}</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{% set navigation_bar = [
|
||||
('/investor', 'investor', 'Investor'),
|
||||
('/enthusiast', 'enthusiast', 'Enthusiast'),
|
||||
] -%}
|
||||
{% set active_page = active_page|default('index') -%}
|
||||
|
||||
<nav class="navbar navbar-inverse">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">pyDataVizDay</a>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="myNavbar">
|
||||
<ul class="nav navbar-nav">
|
||||
{% for href, id, caption in navigation_bar %}
|
||||
<li{% if id == active_page %} class="active"{% endif%}>
|
||||
<a href="{{ href|e }}">{{ caption|e }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{{ body }}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
32
src/templates/pyDataVizDay.py
Normal file
32
src/templates/pyDataVizDay.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
"""
|
||||
PyDataVizDay
|
||||
|
||||
A python implementation of the Data Viz Day visualization built from the Kaggle
|
||||
IMDB 5000 Movie Dataset.
|
||||
|
||||
"""
|
||||
|
||||
from flask import Flask
|
||||
from flask import request, render_template, make_response, jsonify
|
||||
|
||||
|
||||
app = Flask(__name__):
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return render_template('index.html', body='Hello')
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser(description='pyDataVizDay')
|
||||
parser.add_argument('--port', default='5000')
|
||||
parser.add_argument('--debug', dest='debug', action='store_true')
|
||||
parser.add_argument('--no_debug', dest='debug', action='store_false')
|
||||
parser.set_defaults(debug=False)
|
||||
args = parser.parse_args()
|
||||
host = socket.gethostbyname(socket.gethostname())
|
||||
# webbrowser.open('http://' + str(host) + ':' + str(port) + '/')
|
||||
app.run(debug=args.debug, host=str(host), port=int(args.port))
|
||||
Loading…
Add table
Add a link
Reference in a new issue