From 735f16fe70f6f1d182d42d1f5161fe2aebe6aa6d Mon Sep 17 00:00:00 2001 From: Blaise Thompson Date: Sat, 9 Nov 2019 19:41:30 -0600 Subject: initial commit --- app/__init__.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 app/__init__.py (limited to 'app/__init__.py') diff --git a/app/__init__.py b/app/__init__.py new file mode 100644 index 0000000..5e397e4 --- /dev/null +++ b/app/__init__.py @@ -0,0 +1,42 @@ +import pathlib +from flask import Flask, render_template +import flask +from flask_sqlalchemy import SQLAlchemy +import pandas + + +__here__ = pathlib.Path(__file__).parent + + + +df = pandas.read_csv(__here__ / "jobs.csv") + + + + +app = Flask(__name__) +app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db' +db = SQLAlchemy(app) + + +class User(db.Model): + id = db.Column(db.Integer, primary_key=True) + username = db.Column(db.String(80), unique=True) + email = db.Column(db.String(120), unique=True) + + def __repr__(self): + return '' % self.username + +@app.route('/') +@app.route('/jobs') +def jobs(): + #return df.to_html() + return render_template("jobs.html", df=df.to_html()) + +@app.route('/inventory') +def inventory(): + #return df.to_html() + return render_template("inventory.html") + + +app.run(debug=True, port=8000) -- cgit v1.2.3