39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
# app.py - Main Flask Application Entry Point
|
|
|
|
import os
|
|
from flask import Flask
|
|
|
|
from config import SECRET_KEY, STATIC_FOLDER, STATIC_URL_PATH, BEAM_COMBINED_URL, BEAM_API_TOKEN, DATABASE
|
|
from db import init_app as init_db
|
|
from routes import register_blueprints
|
|
|
|
|
|
def create_app():
|
|
app = Flask(__name__, static_folder=STATIC_FOLDER, static_url_path=STATIC_URL_PATH)
|
|
|
|
app.secret_key = SECRET_KEY
|
|
app.config['SESSION_COOKIE_HTTPONLY'] = True
|
|
app.config['SESSION_COOKIE_SAMESITE'] = 'Lax'
|
|
app.config['PERMANENT_SESSION_LIFETIME'] = 86400
|
|
|
|
init_db(app)
|
|
register_blueprints(app)
|
|
|
|
return app
|
|
|
|
|
|
app = create_app()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
print("=" * 60)
|
|
print("🎧 Audiobook Maker Pro v4.2 Starting (dev mode)...")
|
|
print("=" * 60)
|
|
print(f"📍 Beam Combined URL: {BEAM_COMBINED_URL or '❌ NOT SET!'}")
|
|
print(f"📍 Beam Token: {'✅ Configured' if BEAM_API_TOKEN else '❌ NOT CONFIGURED!'}")
|
|
print(f"📍 Database: {DATABASE}")
|
|
print(f"📍 Default Admin: admin / admin123")
|
|
print("=" * 60)
|
|
|
|
app.run(debug=True, host='0.0.0.0', port=5010)
|