2024-10-08 13:20:00 -04:00
|
|
|
import os
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
from flask import Flask
|
|
|
|
|
|
|
|
from kinolist import pages, database, login
|
|
|
|
|
|
|
|
load_dotenv()
|
|
|
|
|
|
|
|
def create_app():
|
|
|
|
app = Flask(__name__)
|
|
|
|
app.config.from_prefixed_env()
|
|
|
|
login.login_manager.init_app(app)
|
|
|
|
database.init_app(app)
|
|
|
|
|
|
|
|
app.register_blueprint(pages.bp)
|
2024-10-13 04:58:48 -04:00
|
|
|
|
|
|
|
base_dir = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
|
|
|
# Set the UPLOAD_FOLDER to the parent directory of your project
|
|
|
|
app.config['UPLOAD_FOLDER'] = os.path.join(base_dir, '..', 'posters')
|
|
|
|
|
2024-10-08 13:20:00 -04:00
|
|
|
return app
|