mirror of
https://github.com/sigmasternchen/Diary
synced 2025-03-15 07:08:56 +00:00
Adduser now works and initdb.py now creates all tables
This commit is contained in:
parent
c453f70d35
commit
84061ccd54
3 changed files with 9 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env python2.7
|
||||
|
||||
import getpass
|
||||
from models import *
|
||||
from database import db_session as db
|
||||
|
||||
passprompt=lambda:(getpass.getpass('Password: '),getpass.getpass('Retype password: '))
|
||||
|
|
|
@ -12,6 +12,3 @@ Base.query=db_session.query_property()
|
|||
def init_db():
|
||||
import models
|
||||
Base.metadata.create_all(bind=engine)
|
||||
|
||||
if __name__=='__main__':
|
||||
init_db()
|
||||
|
|
8
initdb.py
Normal file
8
initdb.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env python2.7
|
||||
|
||||
import database
|
||||
|
||||
if __name__=='__main__':
|
||||
print 'Initialising Database'
|
||||
database.init_db()
|
||||
print 'Initialised Database'
|
Loading…
Reference in a new issue