Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blueprint static content only works when response.direct_passthrough is False #1895

Closed
joaodlf opened this issue Jun 7, 2016 · 1 comment

Comments

@joaodlf
Copy link

joaodlf commented Jun 7, 2016

I'm using the latest version of Flask (0.11.1) and the built in dev server, with the following Blueprint:

blueprint = Blueprint("admin", __name__, url_prefix="/admin", template_folder="templates", static_folder="static")
The template folder is working as expected, but any resources inside the static folder throw a RuntimeError: Attempted implicit sequence conversion but the response object is in direct passthrough mode.

After searching around for this error, I found the following discussion:
closeio/Flask-gzip#7

The solution used in that third party extension was to put in place the following code on app.after_request:
response.direct_passthrough = False

My static content loads fine with the above.

I was wondering if anyone has run into this issue with Blueprints and if there is a better workaround.

@davidism
Copy link
Member

davidism commented Jun 7, 2016

As I said on the SO question, I can't reproduce your issue. If this is a bug with Flask, you'll need to post an example demonstrating that. Please use SO for questions about using Flask.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants