Esempio n. 1
0
def fill_db():
    app = create_app('product')
    _context = app.app_context()
    _context.push()

    fill_post()
    fill_draft()
Esempio n. 2
0
def fill_db():
    app = create_app('product')
    _context = app.app_context()
    _context.push()

    fill_post()
    fill_draft()
Esempio n. 3
0
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()
Esempio n. 4
0
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()
Esempio n. 5
0
	def setUp(self):
		self.app = create_app('test')
		self.app_context = self.app.app_context()
		self.app_context.push()

		self.db = get_db()

		with open('./summer/schema.sql', mode='r') as f:
			self.db.cursor().executescript(f.read())
			self.db.commit()
Esempio n. 6
0
    def setUp(self):
        self.app = create_app('test')
        self.app_context = self.app.app_context()
        self.app_context.push()

        self.db = get_db()

        with open('./summer/schema.sql', mode='r') as f:
            self.db.cursor().executescript(f.read())
            self.db.commit()
Esempio n. 7
0
# -*- 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()
Esempio n. 8
0
# -*- 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()
Esempio n. 9
0
# -*- coding: utf-8 -*-

import sys

reload(sys).setdefaultencoding('utf-8')

from summer.app import create_app

app = create_app()
app.config['DEBUG'] = True

if __name__ == '__main__':
    app.run()