summaryrefslogtreecommitdiff
path: root/shopdb/app/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'shopdb/app/__init__.py')
-rw-r--r--shopdb/app/__init__.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/shopdb/app/__init__.py b/shopdb/app/__init__.py
index 5e397e4..e5ac40c 100644
--- a/shopdb/app/__init__.py
+++ b/shopdb/app/__init__.py
@@ -8,14 +8,11 @@ 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'
+app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:////tmp/test.db"
db = SQLAlchemy(app)
@@ -25,17 +22,19 @@ class User(db.Model):
email = db.Column(db.String(120), unique=True)
def __repr__(self):
- return '<User %r>' % self.username
+ return "<User %r>" % self.username
-@app.route('/')
-@app.route('/jobs')
+
+@app.route("/")
+@app.route("/jobs")
def jobs():
- #return df.to_html()
+ # return df.to_html()
return render_template("jobs.html", df=df.to_html())
-@app.route('/inventory')
+
+@app.route("/inventory")
def inventory():
- #return df.to_html()
+ # return df.to_html()
return render_template("inventory.html")