Flask-JSGlue icon indicating copy to clipboard operation
Flask-JSGlue copied to clipboard

Issue with Jinja2 > 3.0.3

Open sti2dSinBastia opened this issue 2 years ago • 4 comments

Hello, With new version of Jinja2 the Python modules Markup and Escape should be imported from MarkupSafe (https://jinja.palletsprojects.com/en/3.1.x/changes/#version-3-1-1)

Actually it raise an exception :

File "/var/www/site_mbt/flask-app-v2/src/__init__.py", line 11, in <module>
    from flask_jsglue import JSGlue
  File "/var/www/site_mbt/flask-app-v2/venv/lib/python3.8/site-packages/flask_jsglue.py", line 2, in <module>
    from jinja2 import Markup
ImportError: cannot import name 'Markup' from 'jinja2' (/var/www/site_mbt/flask-app-v2/venv/lib/python3.8/site-packages/jinja2/__init__.py)

Thank you for your great job.

sti2dSinBastia avatar Apr 05 '22 09:04 sti2dSinBastia

Yes, I have the same problem.

ideacco avatar Apr 22 '22 11:04 ideacco

You can install Flask-JSGlue2 >=0.3.3

paulmis avatar May 23 '22 13:05 paulmis

@paulmis Does that work? I tried it but get a missing template error when trying to use it. jinja2.exceptions.TemplateNotFound: jsglue/js_bridge.js. Looking at the pip install, I don't see where it properly installs the js_bridge.js template file.

havok2063 avatar Jul 24 '22 20:07 havok2063

You can install Flask-JSGlue2 >=0.3.3

This does not fix the error for me

jfprieur avatar Aug 02 '22 20:08 jfprieur