mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-30 03:10:00 +00:00
Update app.py
This commit is contained in:
9
app.py
9
app.py
@@ -81,10 +81,11 @@ def scan():
|
|||||||
# Run
|
# Run
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# If there are no users, create admin account
|
# If there are no users, create admin account
|
||||||
if User.query.count() == 0:
|
with app.app_context():
|
||||||
admin = User(username="admin", password="admin", is_admin=True)
|
if User.query.count() == 0:
|
||||||
db.session.add(admin)
|
admin = User(username="admin", password="admin", is_admin=True)
|
||||||
db.session.commit()
|
db.session.add(admin)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
app.run(
|
app.run(
|
||||||
host="0.0.0.0",
|
host="0.0.0.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user