Exemplo n.º 1
0
def create_app():
    app = Flask(__name__,
                static_folder="./dist/static",
                template_folder="./dist")

    if os.environ["RUN_ENVIRONMENT"] == 'network':
        app.config[
            'SQLALCHEMY_DATABASE_URI'] = "postgresql+psycopg2://{user}:{pw}@{url}/{db}".format(
                user=os.environ["DB_USER"],
                pw=os.environ["DB_PASS"],
                url=os.environ["DB_URL"],
                db=os.environ["DB_NAME"])
    else:
        app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///{}".format(
            os.path.join(project_dir, "clothingapp.db"))
    app.config['SQLALCHEMY_ECHO'] = True
    db.init_app(app)
    app.register_blueprint(users_api)
    app.register_blueprint(images_api)
    app.register_blueprint(messages_api)
    try:
        from secrets import secret_key
        app.secret_key = secret_key
    except ImportError:
        app.secret_key = secret_key1
    return app
Exemplo n.º 2
0
def create_app():
    app = Flask(__name__,
                static_folder="./dist/static",
                template_folder="./dist")
    app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///{}".format(
        os.path.join(project_dir, "vue-flask-todos.db"))
    app.config['SQLALCHEMY_ECHO'] = True
    db.init_app(app)
    app.register_blueprint(todos_api)

    return app
Exemplo n.º 3
0
def create_app():
    app = Flask(__name__,
        static_folder = "./dist/static",
        template_folder = "./dist"
    )
    app.config['SQLALCHEMY_DATABASE_URI'] = "postgresql+psycopg2://{user}:{pw}@{url}/{db}".format(user=os.environ["DB_USER"],pw=os.environ["DB_PASS"],url=os.environ["DB_URL"],db=os.environ["DB_NAME"])
    app.config['SQLALCHEMY_ECHO'] = True
    db.init_app(app)
    app.register_blueprint(array_api)

    return app
Exemplo n.º 4
0
def create_app():

    app = Flask(__name__,
                static_folder="./dist/static",
                template_folder="./dist")
    print("line 17 in app.py")

    app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///{}".format(
        os.path.join(project_dir, "applicant_info.db"))
    app.config['SQLALCHEMY_ECHO'] = True
    db.init_app(app)

    return app
Exemplo n.º 5
0
def create_app(): 
    app = Flask(__name__,
        static_folder = "./dist/static",
        template_folder = "./dist"
    )
    if os.environ["RUN_ENVIRONMENT"] == 'network':
        app.config['SQLALCHEMY_DATABASE_URI'] = "postgresql+psycopg2://{user}:{pw}@{url}/{db}".format(user=os.environ["DB_USER"],pw=os.environ["DB_PASS"],url=os.environ["DB_URL"],db=os.environ["DB_NAME"])
    else:
        app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///{}".format(os.path.join(project_dir, "podcasts.db"))
    app.config['SQLALCHEMY_ECHO'] = True
    db.init_app(app)
    app.register_blueprint(podcast_api)

    return app