-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage.py
51 lines (36 loc) · 1.02 KB
/
manage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""
File : manage.py
Date : February, 2017
Author : eugene liyai
Desc : Runs the application and initates the database
"""
# ============================================================================
# necessary imports
# ============================================================================
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from bucketlist.app import app
from bucketlist.init_test_db import *
migrate = Migrate(app)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
@manager.command
def initdb():
init_bucketlist_database()
@manager.command
def populatedb():
fill_database()
print('Database populated')
@manager.command
def dropdb():
drop_database_tables()
print('Dropped the database')
@manager.command
def init_test_db():
initialize_test_database()
@manager.command
def drop_test_db():
print('Test database dropped')
drop_test_database()
if __name__ == '__main__':
manager.run()