darshan8950 commited on
Commit
7a11845
·
1 Parent(s): ce830fb

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -0
main.py CHANGED
@@ -11,11 +11,18 @@ import threading
11
 
12
  app = Flask(__name__)
13
 
 
 
 
 
 
 
14
  # Configuration for SQLite database
15
  app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://///code/instance/faces.db'
16
  app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
17
  db = SQLAlchemy(app)
18
 
 
19
  class Frame(db.Model):
20
  id = db.Column(db.Integer, primary_key=True)
21
  frame_data = db.Column(db.LargeBinary) # Use LargeBinary to store binary data
 
11
 
12
  app = Flask(__name__)
13
 
14
+
15
+ database_path = 'code/instance/faces.db'
16
+
17
+ if not os.path.exists(database_path):
18
+ os.makedirs(os.path.dirname(database_path))
19
+
20
  # Configuration for SQLite database
21
  app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://///code/instance/faces.db'
22
  app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
23
  db = SQLAlchemy(app)
24
 
25
+
26
  class Frame(db.Model):
27
  id = db.Column(db.Integer, primary_key=True)
28
  frame_data = db.Column(db.LargeBinary) # Use LargeBinary to store binary data