mattermore/setup_database.py
2019-02-14 19:09:08 +01:00

10 lines
228 B
Python

#!/usr/bin/env python3
from app.app import db, models
db.create_all()
exists = models.User.query.filter_by(username='admin').first()
if not exists:
db.session.add(models.User('admin', admin=True))
db.session.commit()