Update app.py
This commit is contained in:
12
app.py
12
app.py
@@ -1143,15 +1143,3 @@ def seed_db():
|
||||
care_guide=plant['care_guide']
|
||||
))
|
||||
db.session.commit()
|
||||
|
||||
if __name__ == '__main__':
|
||||
with app.app_context():
|
||||
db.create_all()
|
||||
# Create an admin user if not exists
|
||||
if not User.query.filter_by(username='admin').first():
|
||||
admin = User(username='admin')
|
||||
admin.set_password('admin123') # Change this password after first login!
|
||||
db.session.add(admin)
|
||||
db.session.commit()
|
||||
seed_db()
|
||||
app.run(debug=True)
|
||||
Reference in New Issue
Block a user