23 lines
538 B
Python
23 lines
538 B
Python
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)
|
|
|
|
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')
|
|
|
|
return app
|