Bootstrap Flask application
This commit is contained in:
parent
a116d5bc01
commit
e3fd4f20c9
3 changed files with 60 additions and 7 deletions
|
|
@ -29,11 +29,7 @@ def hash(value):
|
|||
|
||||
@provide_db
|
||||
def setup(db):
|
||||
from app.models.user import User
|
||||
db.create_tables([User], safe=True)
|
||||
from app.models.site import Site
|
||||
from app.models.comment import Comment
|
||||
|
||||
# create admin user if user table is empty
|
||||
if User.select().count() == 0:
|
||||
admin_user = User(username='admin', password=hash('admin'),
|
||||
displayname='Admin')
|
||||
admin_user.save()
|
||||
db.create_tables([Site, Comment], safe=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue