Exemple #1
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from xiaoli import create_app
from xiaoli.config import setting

__author__ = 'zouyingjun'

app = create_app(config=setting)
Exemple #2
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import traceback
from flask.ext.script import Manager, prompt_bool
from sqlalchemy.orm.exc import NoResultFound
from xiaoli import create_app
from xiaoli.config import setting
from xiaoli import models
from xiaoli.models import Account
from xiaoli.models.base import Base, engine
from xiaoli.models.session import db_session_cm

__author__ = 'zouyingjun'


app = create_app(setting)

manager = Manager(app)


@manager.shell
def make_shell_context():
    return dict(app=app, db=engine, models=models)


@manager.command
def show_config():
    u"""展示所有配置信息"""
    for key in sorted(dir(setting)):
        if key.isupper():
            print key, '=', getattr(setting, key)