diff --git a/run.py b/run.py index 8210483..c8ccd28 100644 --- a/run.py +++ b/run.py @@ -1,35 +1,37 @@ # -*- coding: utf-8 -*- # # Copyright 2014 Kolab Systems AG (http://www.kolabsys.com) # # Thomas Bruederli # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # import os -from flask.ext.script import Manager, Shell +from flask_script import Manager, Shell from app import create_app, db app = create_app(os.getenv('FLASK_CONFIG') or 'default') manager = Manager(app) + def make_shell_context(): from app.model import User, Permission return dict(app=app, db=db, User=User, Permission=Permission) + manager.add_command('shell', Shell(make_context=make_shell_context)) if __name__ == '__main__': manager.run()