示例#1
0
 def create_app(self):
     app = create_app('testing')
     app.config['TESTING'] = True
     return app
示例#2
0
#!/usr/bin/env python

import os
import sys

from flask.ext.script import Manager, prompt, Shell
from flask.ext.migrate import Migrate, MigrateCommand

from monetario.app import create_app
from monetario.models import App
from monetario.models import User
from monetario.extensions import db

app = create_app()
manager = Manager(app)
migrate = Migrate(app, db)


def make_shell_context():
    return {'app': app, 'db': db, 'User': User}


manager.add_command("shell", Shell(make_context=make_shell_context))
manager.add_command('db', MigrateCommand)

API_APPS = [{
    'name':
    'WEB',
    'secret':
    'eyJpYXQiOjE0NTc1NTc0MDYsImV4cCI6MTYxNTIzNzQwNiwiYWxnIjoiSFMyNTYifQ.eyJpZCI6MX0.FIVRju7qroqF1UYFG3d8e_gAUVQbzHWmjjAhgrl4KKw',
}]
示例#3
0
文件: manage.py 项目: monetario/core
#!/usr/bin/env python

import os
import sys

from flask.ext.script import Manager, prompt, Shell
from flask.ext.migrate import Migrate, MigrateCommand

from monetario.app import create_app
from monetario.models import App
from monetario.models import User
from monetario.extensions import db

app = create_app()
manager = Manager(app)
migrate = Migrate(app, db)


def make_shell_context():
    return {'app': app, 'db': db, 'User': User}

manager.add_command("shell", Shell(make_context=make_shell_context))
manager.add_command('db', MigrateCommand)


API_APPS = [
    {
        'name': 'WEB',
        'secret': 'eyJpYXQiOjE0NTc1NTc0MDYsImV4cCI6MTYxNTIzNzQwNiwiYWxnIjoiSFMyNTYifQ.eyJpZCI6MX0.FIVRju7qroqF1UYFG3d8e_gAUVQbzHWmjjAhgrl4KKw',
    }
]