remove index app and replace index route inside __init__
This commit is contained in:
@@ -197,14 +197,12 @@ def create_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.threads import bp as threads_bp
|
||||
from app.routes.users import bp as users_bp
|
||||
from app.routes.guides import bp as guides_bp
|
||||
from app.routes.mod import bp as mod_bp
|
||||
from app.routes.posts import bp as posts_bp
|
||||
app.register_blueprint(app_bp)
|
||||
app.register_blueprint(topics_bp)
|
||||
app.register_blueprint(threads_bp)
|
||||
app.register_blueprint(users_bp)
|
||||
@@ -328,6 +326,11 @@ def create_app():
|
||||
return {'error': 'forbidden'}, e.code
|
||||
else:
|
||||
return render_template('common/403.html'), e.code
|
||||
|
||||
@app.get('/')
|
||||
def index():
|
||||
return redirect(url_for('topics.all_topics'))
|
||||
|
||||
#
|
||||
# @app.errorhandler(413)
|
||||
# def _handle_413(e):
|
||||
|
||||
@@ -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'))
|
||||
Reference in New Issue
Block a user