Beispiel #1
0
def main():
    core = os.environ["CORE"]
    db_path = os.path.join(core, "backend/database.db")
    os.environ["DATABASE_FILE_PATH"] = f"/{db_path}"

    app = Flask(__name__)
    app.app_context().push()

    init_app(app)
    db.create_all()

    print("seeding admin users")
    seed_admins(db, "users.tsv")
    print("seeding lifts")
    seed_class(db, "lifts.tsv", Lift)
Beispiel #2
0
def client():
    """
    Create a wrapped flask app.
    This is used for unittests that want to mock out all
    underlying singletons (such as DBs).
    Assumes that app.security has been set.
    """

    from flask import Flask
    from src.app import init_app
    from src.models import User, Role
    from .test_utils import WrapApp

    app = Flask("testing")
    init_app(app, ":memory:", "secret key foo", "password salt bar")

    app.config["TESTING"] = True
    bmock = Mock()
    return WrapApp(app, User, Role, mocks={"blog_mock": bmock})
Beispiel #3
0
def main():
    """
        Standalone server startup script
    """
    app = init_app()

    web.run_app(
        app,
        host=settings.HOST,
        port=settings.PORT,
    )
Beispiel #4
0
from src.app import app, init_app

if __name__ == "__main__":
    init_app(app)
    app.run(debug=True)
Beispiel #5
0
from src.app import application, init_app

init_app(application)

if __name__ == '__main__':
    application.debug = True
    #init_app(application)
    application.run(host='0.0.0.0', port=5003)
Beispiel #6
0
from src.app import init_app

app = init_app()
Beispiel #7
0
async def create_app():
    """
        Application factory used by gunicorn
    """
    app = init_app()
    return app
Beispiel #8
0
import os

from src.app import init_app

if __name__ == '__main__':
    ##retrieve the environment variable from the terminal
    env_name = os.getenv('FLASK_ENV')

    app = init_app(env_name)

    ## run the app
    app.run()
Beispiel #9
0
import asyncio
from src.app import init_app

if __name__ == '__main__':
    asyncio.run(init_app())