Install & Compatibility
Where this runs
tested against v0.10.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.494s · 22.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.2s · import 0.462s · 23MB
21MB installed
● package 21MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
RequestID
✓ from flask_log_request_id import RequestID
✗ from flask.ext.log_request_id import RequestID
Deprecated Flask extension import pattern (Flask <0.12). Use the modern import.
current_request_id
✓ from flask_log_request_id import current_request_id
✗ from flask.ext.log_request_id import get_current_request_id
Function name changed. The proxy is called current_request_id.
Initialize the extension with your Flask app and use current_request_id() to get the current request ID.
from flask import Flask
from flask_log_request_id import RequestID, current_request_id
app = Flask(__name__)
RequestID(app)
@app.route('/')
def index():
return f"Request ID: {current_request_id()}"
if __name__ == '__main__':
app.run()
Errors
Common errors & fixes
AttributeError: module 'flask_log_request_id' has no attribute 'current_request_id'
Typo or wrong import path. Common mistake: using 'current_request_id' instead of 'current_request_id' (underscore). Also check if you imported the correct symbol.
fixUse: from flask_log_request_id import current_request_id
flask.exceptions.ImportError: cannot import name 'RequestID' from 'flask.ext.log_request_id'
Using the deprecated import pattern flask.ext.log_request_id which is not supported in newer Flask versions.
fixReplace with: from flask_log_request_id import RequestID
RuntimeError: Working outside of request context.
Calling current_request_id() outside of a Flask request context (e.g., in a background thread).
fixEnsure you are inside a request context, or pass the request ID explicitly to the background task.
Upgrade
Version history
0.10.1latest on PyPI · released Oct 31, 2019
Audit
Dependencies
No dependency data recorded yet.