-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Update to work with flask 2.2+ #155
Conversation
Removed _request_ctx_stack.top in favor of reqquest_ctx as shown in https://github.com/pallets/flask/pull/4682/files.
Bump. @miracle2k any chance you could merge this and create a new release? Thanks! |
+1 |
btw, this also seems to fix the problem of you can install my branch
|
@christopherpickering I'm running into issues with non-static assets. Using |
hey @cajual what is the error message? Was that working previously? There must be another change in flask causing the fail... if you put the full message and how I can reproduce it, I can try to help. |
@christopherpickering sure. To caveat, I use
After making the changes reflected in this to my local installation of
Which is directly related to this segment of code:
The flask debugger provides the following information about these vars:
So I attempted to force a
But now I run into an issue with Jinja2:
So at this point I've just decided there must be a better way to approach this, but it all starts at |
@cajual I'm able to use npm packages. Since flask assets servers from the Here's the app: npm init -y
npm install jquery`
poetry init
poetry add git+https://github.com/christopherpickering/flask-assets.git
poetry add flask
poetry add jsmin # main.py
from flask import Flask
from flask import render_template
from flask_assets import Environment, Bundle
app = Flask(__name__)
assets = Environment(app)
js = Bundle(
"../node_modules/jquery/dist/jquery.js",
filters=("jsmin"),
output="gen/packed.js",
)
assets.register('js_all', js)
@app.route("/")
def hello_world():
return render_template('index.html') and the template <!-- /templates/index.html -->
{% assets "js_all" -%}
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endassets %} then running poetry run flask --app main run I wasn't sure what your |
@christopherpickering confirmed, this is specifically a |
Small improvements that will make this a fully working solution (with CLI):
Also it would be better to rewrite the import check
to use
|
Any news on this one? flask-assets is breaking with Flask 3.0 due to this issue. |
@prohde https://pypi.org/project/Flask-Assets2 this fork from @nkgilley seems to be working with Flask 3.0 see #158 |
I'm will help to maintain this project. I will fix the tests and set up the GitHub actions first, then handle the pull requests. There will be a new release this week. |
Removed _request_ctx_stack.top in favor of reqquest_ctx as shown in https://github.com/pallets/flask/pull/4682/files.