def run(): app = create_app() with app.app_context(): run_report()
def run(): app = create_app() with app.app_context(): load_data()
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import os from flask import current_app from flask_script import Manager, Shell, Server from flask_migrate import MigrateCommand from feedback.app import create_app from feedback.database import db from feedback.settings import (DevelopmentConfig, ProductionConfig, StagingConfig, TestingConfig) app = create_app() HERE = os.path.abspath(os.path.dirname(__file__)) TEST_PATH = os.path.join(HERE, 'tests') manager = Manager(app) def _make_context(): """Return context dict for a shell session so you can access app, db, and the User model by default. """ return {'app': app} @manager.option('-e', '--email', dest='email', default=None) @manager.option('-s', '--section', dest='section', default=None) def seed_stakeholder(email, section):
# -*- coding: utf-8 -*- import datetime import os from flask import current_app from flask_script import Manager, Shell, Server from flask_migrate import MigrateCommand from feedback.app import create_app from feedback.database import db from feedback.settings import ( DevelopmentConfig, ProductionConfig, StagingConfig, TestingConfig ) app = create_app() HERE = os.path.abspath(os.path.dirname(__file__)) TEST_PATH = os.path.join(HERE, 'tests') manager = Manager(app) def _make_context(): """Return context dict for a shell session so you can access app, db, and the User model by default. """ return { 'app': app }