remove index app and replace index route inside __init__

This commit is contained in:
2026-04-29 21:23:15 +03:00
parent 4bcea261b1
commit 648b310e13
2 changed files with 5 additions and 8 deletions

View File

@@ -197,14 +197,12 @@ def create_app():
cache.init_app(app) cache.init_app(app)
from app.routes.app import bp as app_bp
from app.routes.topics import bp as topics_bp from app.routes.topics import bp as topics_bp
from app.routes.threads import bp as threads_bp from app.routes.threads import bp as threads_bp
from app.routes.users import bp as users_bp from app.routes.users import bp as users_bp
from app.routes.guides import bp as guides_bp from app.routes.guides import bp as guides_bp
from app.routes.mod import bp as mod_bp from app.routes.mod import bp as mod_bp
from app.routes.posts import bp as posts_bp from app.routes.posts import bp as posts_bp
app.register_blueprint(app_bp)
app.register_blueprint(topics_bp) app.register_blueprint(topics_bp)
app.register_blueprint(threads_bp) app.register_blueprint(threads_bp)
app.register_blueprint(users_bp) app.register_blueprint(users_bp)
@@ -328,6 +326,11 @@ def create_app():
return {'error': 'forbidden'}, e.code return {'error': 'forbidden'}, e.code
else: else:
return render_template('common/403.html'), e.code return render_template('common/403.html'), e.code
@app.get('/')
def index():
return redirect(url_for('topics.all_topics'))
# #
# @app.errorhandler(413) # @app.errorhandler(413)
# def _handle_413(e): # def _handle_413(e):

View File

@@ -1,6 +0,0 @@
from flask import Blueprint, redirect, url_for, render_template
bp = Blueprint('app', __name__, url_prefix = '/')
@bp.get('/')
def index():
return redirect(url_for('topics.all_topics'))