first
This commit is contained in:
33
routes/__init__.py
Normal file
33
routes/__init__.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from flask import Blueprint, Flask, render_template
|
||||
from flask_login import login_required
|
||||
|
||||
def init_app(app: Flask):
|
||||
# Create blueprints
|
||||
main_bp = Blueprint('main', __name__)
|
||||
auth_bp = Blueprint('auth', __name__, url_prefix='/auth')
|
||||
rooms_bp = Blueprint('rooms', __name__)
|
||||
|
||||
# Import and initialize routes
|
||||
from .main import init_routes as init_main_routes
|
||||
from .auth import init_routes as init_auth_routes
|
||||
from .contacts import contacts_bp as contacts_routes
|
||||
from .rooms import rooms_bp as rooms_routes
|
||||
|
||||
# Initialize routes
|
||||
init_main_routes(main_bp)
|
||||
init_auth_routes(auth_bp)
|
||||
|
||||
# Register blueprints
|
||||
app.register_blueprint(main_bp)
|
||||
app.register_blueprint(auth_bp)
|
||||
app.register_blueprint(rooms_routes)
|
||||
app.register_blueprint(contacts_routes)
|
||||
|
||||
@app.route('/rooms/<int:room_id>/trash')
|
||||
@login_required
|
||||
def trash_page(room_id):
|
||||
return render_template('trash.html')
|
||||
|
||||
return app
|
||||
|
||||
# This file makes the routes directory a Python package
|
||||
Reference in New Issue
Block a user