Stiivi/cubes — pull request #111 by tomasd (2013-03-22 07:14:02+00:00)
Title: Slicer as Flask blueprint

I've created flask blueprint for slicer. Basically it's copy and paste of current Slicer controllers with small adjustments.

You have to instantiate blueprint and pass in the name and workspace as arguments (url_prefix as optional, default is '/slicer'). This way you can create several slicer instances on different urls for different cubes workspaces:

app = flask.Flask(__name__)
workspace = cubes.create_workspace(...)
app.register_blueprint(cubes.server.SlicerBlueprint(workspace, 'slicer', url_prefix='/slicer'))

There is still one issue to solve. User may want to decorate views with decorators like login_required if he wants authenticated access to the slicer.