Add Github login

This commit is contained in:
rubenwardy
2018-03-18 18:05:53 +00:00
parent 7f4faf21fa
commit 7d20c49ebb
9 changed files with 196 additions and 62 deletions

View File

@@ -6,12 +6,15 @@ if delete_db and os.path.isfile("app/data.sqlite"):
os.remove("app/data.sqlite")
if not os.path.isfile("app/data.sqlite"):
from app import models
from app.models import *
print("Creating database tables...")
models.db.create_all()
db.create_all()
print("Filling database...")
models.db.session.commit()
ruben = User("rubenwardy")
ruben.github_username = "rubenwardy"
db.session.add(ruben)
db.session.commit()
else:
print("Database already exists")