Example #1
0
 def create_app(self):
     app = Flask(__name__)
     app.config["TESTING"] = True
     app.config["SERVER_NAME"] = "localhost"
     app.config["SECRET_KEY"] = "secret secret"
     app.config["IMAGES_PATH"] = ["assets"]
     self.images = Images(app)
     return app
Example #2
0
def create_app():
    app = Flask(__name__)
    app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///" + os.path.join(basedir, "data.sqlite")
    app.config["SQLALCHEMY_COMMIT_ON_TEARDOWN"] = True
    app.config["SECRET_KEY"] = "BohemianRhapsody"
    app.config["IMAGES_PATH"] = os.path.join(basedir)
    db.init_app(app)
    login_manager.init_app(app)

    from .api import api as api_blueprint

    app.register_blueprint(api_blueprint)
    return app