Jul 10 - Update codes to catch up with the single tenant project
This commit is contained in:
@@ -32,6 +32,12 @@ def create_app(config_name='default'):
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(config[config_name])
|
||||
|
||||
# Unwrap X-Forwarded-For / X-Forwarded-Proto set by Nginx so Flask sees
|
||||
# the real client IP (needed for rate limiting and fail2ban logging) and
|
||||
# the real scheme (needed for HTTPS URL generation in emails).
|
||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1)
|
||||
|
||||
db.init_app(app)
|
||||
login_manager.init_app(app)
|
||||
migrate.init_app(app, db)
|
||||
|
||||
Reference in New Issue
Block a user