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

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

    fill_post()
    fill_draft()
Beispiel #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()
Beispiel #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()
Beispiel #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()
Beispiel #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()
Beispiel #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()
Beispiel #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()
Beispiel #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()