From 1808c8238f902dd3ec3913a808528a3978e96881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=93=D0=B5=D0=BD=D0=BD=D0=B0=D0=B4=D1=8C=D0=B5=D0=B2=D0=B8?= =?UTF-8?q?=D1=87=20=D0=A1=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9?= Date: Mon, 17 Oct 2022 20:59:54 +0300 Subject: [PATCH] created models --- .gitignore | 1 + app.py | 21 +++++++++++++++++++++ models.py | 9 +++++++++ 3 files changed, 31 insertions(+) diff --git a/.gitignore b/.gitignore index 5d381cc..82dfe37 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,4 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ +venv diff --git a/app.py b/app.py index e69de29..564e3dd 100644 --- a/app.py +++ b/app.py @@ -0,0 +1,21 @@ +from flask import Flask, render_template +from models import db + + + + +app = Flask(__name__) +app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////app.db' +db.init_app(app) + + +@app.route("/") +def index(): + return render_template("index.html") + + + + + +if __name__ == "__main__": + app.run(host="0.0.0.0", debug="True", port="3800") \ No newline at end of file diff --git a/models.py b/models.py index e69de29..7f2d324 100644 --- a/models.py +++ b/models.py @@ -0,0 +1,9 @@ +from flask_sqlalchemy import SQLAlchemy + +db = SQLAlchemy() + +class PrintedDetal(db.Model): + id = db.Column(db.Integer, primary_key=True) + imgpath = db.Column(db.String(3000)) + stlpath = db.Column(db.String(3000)) + isprinted = db.Column(db.Boolean()) \ No newline at end of file