예제 #1
0
    def make_blueprint(self, name='module', import_name=None, **kw):
        if not import_name:
            import test_module
            import_name = test_module.__name__

        if not Blueprint:
            self.module = Module(import_name, name=name)
            self.app.register_module(self.module)
        else:
            self.blueprint = Blueprint(name, import_name, **kw)
            self.app.register_blueprint(self.blueprint)
예제 #2
0
 def setup(self):
     self.app = Flask(__name__, static_path='/app_static')
     import test_module
     if not Blueprint:
         self.module = Module(test_module.__name__,
                              name='module',
                              static_path='/mod_static')
         self.app.register_module(self.module)
     else:
         self.blueprint = Blueprint('module',
                                    test_module.__name__,
                                    static_url_path='/mod_static',
                                    static_folder='static')
         self.app.register_blueprint(self.blueprint)
     self.env = Environment(self.app)