/
manage.py
executable file
·34 lines (27 loc) · 933 Bytes
/
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
import os
import sys
from flask import current_app
from flask.ext.script import Manager,prompt,prompt_pass,\
prompt_bool,prompt_choices
from flask.ext.script import Server
from missing import configs
from missing.configs import db
from missing import create_app
app = create_app(configs.ProductionConfig)
manager = Manager(app)
@manager.command
def create_all():
if prompt_bool("Are you sure? You will init your database"):
db.create_all()
@manager.command
def drop_all():
if prompt_bool("Are you sure? You will lose all your data!"):
db.drop_all()
@manager.option('-u','--username',dest='username',required=True)
@manager.option('-p','--password',dest='password',required=True)
@manager.option('-e','--email',dest='email',required=True)
def createuser(username=None,password=None,email=None):
pass
manager.add_command('runserver',Server())
if __name__ == '__main__':
manager.run()