stewartpark / Flask-JSGlue

Flask-JSGlue helps hook up your Flask application nicely with the front end.
80 stars 39 forks source link

Issue with Jinja2 > 3.0.3 #33

Open sti2dSinBastia opened 2 years ago

sti2dSinBastia commented 2 years ago

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.

ideacco commented 2 years ago

Yes, I have the same problem.

paulmis commented 2 years ago

You can install Flask-JSGlue2 >=0.3.3

havok2063 commented 2 years ago

@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.

jfprieur commented 2 years ago

You can install Flask-JSGlue2 >=0.3.3

This does not fix the error for me