Beispiel #1
0
from .controllers.DocsController import DocsController
from .controllers.Features import Features
Features.register(examples)
MainController.register(examples)
UploadsController.register(examples)
SecurityController.register(examples)
WTFormsController.register(examples)
DocsController.register(examples)

from flask_menu.classy import register_flaskview
register_flaskview(examples, MainController)
register_flaskview(examples, UploadsController)
register_flaskview(examples, SecurityController)
register_flaskview(examples, WTFormsController)
register_flaskview(examples, Features)
register_flaskview(examples, DocsController)

from .modules.submodule import submodule
examples.register_blueprint(submodule, url_prefix='/submodule/<int:id>')

import os
examples_dir = os.path.realpath(
    os.path.join(os.path.realpath(__file__), '../../../../../../'))


@examples.app_template_global('load_file_with_name')
def load_file_with_name(filename):
    fpath = os.path.join(examples_dir, filename)
    with open(fpath) as fh:
        return fh.read()
Beispiel #2
0
from flask_boilerplate_utils.overrides import NestableBlueprint
from flask.ext import menu
from flask_menu.classy import register_flaskview

frontend = NestableBlueprint('frontend',
                             __name__,
                             template_folder="templates",
                             static_folder="static")

from .controllers.Index import Index

Index.register(frontend)
register_flaskview(frontend, Index)

# Pragma - Submodule Registration Start
# Anything after the above line will be removed after cleanup.
from .modules.learn_flask import learn_flask
from .modules.examples import examples
from .modules.cleanup import cleanup

frontend.register_blueprint(learn_flask, url_prefix='/learn-flask')
frontend.register_blueprint(examples, url_prefix='/examples')
frontend.register_blueprint(cleanup, url_prefix='/cleanup')
from .controllers.SecurityController import SecurityController
from .controllers.WTFormsController import WTFormsController
from .controllers.DocsController import DocsController
from .controllers.Features import Features
Features.register(examples)
MainController.register(examples)
UploadsController.register(examples)
SecurityController.register(examples)
WTFormsController.register(examples)
DocsController.register(examples)

from flask.ext import menu
menu.register_flaskview(examples, MainController)
menu.register_flaskview(examples, UploadsController)
menu.register_flaskview(examples, SecurityController)
menu.register_flaskview(examples, WTFormsController)
menu.register_flaskview(examples, Features)
menu.register_flaskview(examples, DocsController)

from .modules.submodule import submodule
examples.register_blueprint(submodule, url_prefix='/submodule/<int:id>')

import os
examples_dir = os.path.realpath(os.path.join(os.path.realpath(__file__), '../../../../../../'))
@examples.app_template_global('load_file_with_name')
def load_file_with_name(filename):
    fpath = os.path.join(examples_dir, filename)
    with open(fpath) as fh: 
        return fh.read()

from flask_boilerplate_utils.overrides import NestableBlueprint
from flask.ext import menu

frontend = NestableBlueprint('frontend', __name__, template_folder="templates", 
    static_folder="static")

from .controllers.Index import Index
Index.register(frontend)
menu.register_flaskview(frontend, Index)

# Pragma - Submodule Registration Start
# Anything after the above line will be removed after cleanup.
from .modules.learn_flask import learn_flask
from .modules.examples import examples
from .modules.cleanup import cleanup
frontend.register_blueprint(learn_flask, url_prefix='/learn-flask')
frontend.register_blueprint(examples, url_prefix='/examples')
frontend.register_blueprint(cleanup, url_prefix='/cleanup')
Beispiel #5
0
from flask_boilerplate_utils.overrides import NestableBlueprint
from flask.ext import menu
from flask_menu.classy import register_flaskview

frontend = NestableBlueprint("frontend", __name__, template_folder="templates", static_folder="static")

from .controllers.Index import Index

Index.register(frontend)
register_flaskview(frontend, Index)

# Pragma - Submodule Registration Start
# Anything after the above line will be removed after cleanup.
from .modules.learn_flask import learn_flask
from .modules.examples import examples
from .modules.cleanup import cleanup

frontend.register_blueprint(learn_flask, url_prefix="/learn-flask")
frontend.register_blueprint(examples, url_prefix="/examples")
frontend.register_blueprint(cleanup, url_prefix="/cleanup")