示例#1
0
 def create_app(self):
     app = create_app(self)
     # the .env still overwrites fgsfds
     app.config['DB_DATABASE'] = 'flfm_tests'
     app.config['USERS_HOME_FOLDERS'] = self.user_homes
     return app
示例#2
0
文件: test_media.py 项目: m-flak/flfm
 def create_app(self):
     return create_app(self)
示例#3
0
from flask_script import Manager, prompt, prompt_bool, prompt_pass
from flask_migrate import Migrate, MigrateCommand
from flfm import create_app, db
from flfm.models import User
from config import Config

app = create_app(Config)

migrate = Migrate(app, db)
manager = Manager(app)

manager.add_command('db', MigrateCommand)


@manager.option('-u', '--username', dest="username", required=False)
@manager.option('-p', '--password', dest="password", required=False)
@manager.option('-a', '--admin', dest="admin", required=False)
def createuser(username=None, password=None, admin=None):
    """Create a user account for the application.
    """
    u_name = username
    pw = password
    make_admin = admin

    if u_name is None:
        while True:
            u_name = prompt("User Name")
            user = User.query.filter(User.name == u_name).first()
            if user is not None:
                print("{}: USER ALREADY EXISTS!".format(u_name))
            else: