from ehuigo.extensions import db from ehuigo.scripts.init_data import init_manufacturers_and_products, init_questions_and_answers, init_user from config import config # 覆盖检测 COV = None if os.environ.get('FLASK_COVERAGE'): import coverage COV = coverage.coverage(branch=True, include='ehuigo/*') COV.start() config_name = 'development' app = create_app(config_name) def _make_shell_context(): from ehuigo.models import User return dict(app=app, db=db, User=User) manager = Manager(app) manager.add_command('db', MigrateCommand) manager.add_command('shell', Shell(make_context=_make_shell_context)) # manager.add_command('debug', Server(host='127.0.0.1', port=8080, debug=True)) @manager.command def debug():
def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_context.push() db.create_all()
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from ehuigo import create_app from config import config app = create_app('ace') application = app.wsgi_app