first part of master_slave relation
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from flask import Blueprint, Flask, render_template
|
||||
from flask_login import login_required
|
||||
from models import SiteSettings
|
||||
import os
|
||||
|
||||
def init_app(app: Flask):
|
||||
# Create blueprints
|
||||
@@ -28,6 +29,11 @@ def init_app(app: Flask):
|
||||
site_settings = SiteSettings.query.first()
|
||||
return dict(site_settings=site_settings)
|
||||
|
||||
# Add MASTER environment variable to all templates
|
||||
@app.context_processor
|
||||
def inject_master():
|
||||
return dict(is_master=os.environ.get('MASTER', 'false').lower() == 'true')
|
||||
|
||||
# Register blueprints
|
||||
app.register_blueprint(main_bp)
|
||||
app.register_blueprint(auth_bp)
|
||||
|
||||
Reference in New Issue
Block a user