Пример #1
0
# a little trick so you can run:
# $ python example/app.py
# from the root of the security project
import sys, os

sys.path.pop(0)
sys.path.insert(0, os.getcwd())

from example import app
from flask.ext.script import Manager
from flask.ext.security.script import (
    CreateUserCommand,
    AddRoleCommand,
    RemoveRoleCommand,
    ActivateUserCommand,
    DeactivateUserCommand,
)

manager = Manager(app.create_sqlalchemy_app())
manager.add_command("create_user", CreateUserCommand())
manager.add_command("add_role", AddRoleCommand())
manager.add_command("remove_role", RemoveRoleCommand())
manager.add_command("deactivate_user", DeactivateUserCommand())
manager.add_command("activate_user", ActivateUserCommand())

if __name__ == "__main__":
    manager.run()
Пример #2
0
# a little trick so you can run:
# $ python example/app.py
# from the root of the security project
import sys, os
sys.path.pop(0)
sys.path.insert(0, os.getcwd())

from example import app
from flask.ext.script import Manager
from flask.ext.security.script import (CreateUserCommand, AddRoleCommand,
                                       RemoveRoleCommand, ActivateUserCommand,
                                       DeactivateUserCommand)

manager = Manager(app.create_sqlalchemy_app())
manager.add_command('create_user', CreateUserCommand())
manager.add_command('add_role', AddRoleCommand())
manager.add_command('remove_role', RemoveRoleCommand())
manager.add_command('deactivate_user', DeactivateUserCommand())
manager.add_command('activate_user', ActivateUserCommand())

if __name__ == "__main__":
    manager.run()
Пример #3
0
 def _create_app(self, auth_config):
     return app.create_sqlalchemy_app(auth_config)
Пример #4
0
 def _create_app(self, auth_config):
     return app.create_sqlalchemy_app(auth_config)