Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def init_db():
app = create_app('product')
_context = app.app_context()
_context.push()
with closing(connect_db()) as db:
with open('./summer/schema.sql', mode='r') as f:
db.cursor().executescript(f.read())
db.commit()
# -*- coding: utf-8 -*-
import sys
reload(sys).setdefaultencoding('utf-8')
from summer.app import create_app
app = create_app('product')
if __name__ == '__main__':
app.run()
def fill_db():
app = create_app('product')
_context = app.app_context()
_context.push()
fill_post()
fill_draft()
# -*- coding: utf-8 -*-
from flask.ext.script import Manager
from summer.app import create_app
app = create_app('product')
manager = Manager(app)
@manager.command
def web():
app.run()
if __name__ == "__main__":
manager.run()