Spaces:
Sleeping
Sleeping
Download app/__init__.py from Moealsarraj/contentforge: direct link, hf CLI and curl.
- Browser
- Download file 969 Bytes
-
https://huggingface.co/spaces/Moealsarraj/contentforge/resolve/main/app/__init__.py
- Command line
-
hf download hf://spaces/Moealsarraj/contentforge/app/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/Moealsarraj/contentforge/resolve/main/app/__init__.py
969 Bytes
| """ContentForge — Flask app factory.""" | |
| import os | |
| from flask import Flask | |
| from flask_wtf.csrf import CSRFProtect | |
| _csrf = CSRFProtect() | |
| def create_app(): | |
| app = Flask(__name__, template_folder="templates") | |
| app.config["SECRET_KEY"] = os.environ.get("SECRET_KEY", "dev-contentforge-2026") | |
| app.config["MAX_CONTENT_LENGTH"] = 30 * 1024 * 1024 | |
| _csrf.init_app(app) | |
| from app.home.routes import bp as home_bp | |
| app.register_blueprint(home_bp) | |
| from app.tools.content_repurposer.routes import bp as content_repurposer_bp | |
| app.register_blueprint(content_repurposer_bp, url_prefix='/content-repurposer') | |
| from app.tools.ai_debate_arena.routes import bp as ai_debate_arena_bp | |
| app.register_blueprint(ai_debate_arena_bp, url_prefix='/ai-debate-arena') | |
| from flask import jsonify | |
| def _handle_exc(e): | |
| code = getattr(e, "code", 500) | |
| return jsonify({"error": str(e)}), code | |
| return app |