Ejemplo n.º 1
0
    def setUp(self):
        from app import app
        app.config.update(
            SERVER_NAME='localhost:%s' % app.config.get('PORT')
        )
        self.app = app.test_client()
        from app import db
        self.db = db

        user = User('%s' % str(uuid.uuid4())[:8],
                    '*****@*****.**' % str(uuid.uuid4())[:8],
                    '%s' % str(uuid.uuid4())[:8])
        user.role_admin = True
        self.db.session.add(user)
        self.user_admin = user

        user = User('%s' % str(uuid.uuid4())[:8],
                    '*****@*****.**' % str(uuid.uuid4())[:8],
                    '%s' % str(uuid.uuid4())[:8])
        self.db.session.add(user)
        self.user_user = user

        self.baseUrl = 'http://localhost:%s' % app.config.get('PORT')
Ejemplo n.º 2
0
app.register_blueprint(auth)

from .objects.controllers import app as objects
app.register_blueprint(objects)

from .stats.controllers import app as stats
app.register_blueprint(stats)


@app.route('/robots.txt')
def overview():
    return send_from_directory(app.static_folder, request.path[1:])


db.create_all()

# Create initial user if there is no user in db
from app.auth.models import User
if User.query.count() == 0:
    import uuid
    user = User('admin', '*****@*****.**', str(uuid.uuid4())[0:8])
    user.role_admin = True
    db.session.add(user)
    db.session.commit()
    print('''===
Welcome to your new %s installation!
A new admin account has been created.
Login: %s
Password: %s
===''' % (app.config['APP_NAME'], user.email, user.plain_password))
Ejemplo n.º 3
0
app.register_blueprint(auth)

from .objects.controllers import app as objects
app.register_blueprint(objects)

from .stats.controllers import app as stats
app.register_blueprint(stats)


@app.route('/robots.txt')
def overview():
    return send_from_directory(app.static_folder, request.path[1:])


db.create_all()

# Create initial user if there is no user in db
from app.auth.models import User
if User.query.count() == 0:
    import uuid
    user = User('admin', '*****@*****.**', str(uuid.uuid4())[0:8])
    user.role_admin = True
    db.session.add(user)
    db.session.commit()
    print('''===
Welcome to your new %s installation!
A new admin account has been created.
Login: %s
Password: %s
===''' % (app.config['APP_NAME'], user.email, user.plain_password))