-
Notifications
You must be signed in to change notification settings - Fork 30
/
app.py
44 lines (30 loc) · 850 Bytes
/
app.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
# coding: utf-8
import sys
import logging
from zerqu import create_app
from zerqu.models import db
app = create_app({'DEBUG': True})
def show_verbose_log():
formatter = logging.Formatter(
'[%(levelname)s %(funcName)s %(filename)s:%(lineno)d]: %(message)s'
)
handler = logging.StreamHandler(sys.stdout)
handler.setFormatter(formatter)
log = logging.getLogger('flask_oauthlib')
log.addHandler(handler)
log.setLevel(logging.DEBUG)
log = logging.getLogger('oauthlib')
log.addHandler(handler)
log.setLevel(logging.DEBUG)
def create_database():
import fixtures
with app.app_context():
db.drop_all()
db.create_all()
fixtures.run()
if '--initdb' in sys.argv:
create_database()
sys.exit()
with app.app_context():
db.create_all()
app.run(host='0.0.0.0')