Crown-Commercial-Service / govuk-frontend-jinja

Tools to use the GOV.UK Design System with Python webapps that use Jinja2 and Flask 🐍
MIT License
9 stars 6 forks source link

Not compatible with Flask 2.x #66

Open quis opened 3 years ago

quis commented 3 years ago

This line: https://github.com/alphagov/govuk-frontend-jinja/blob/ddbe208a976ffa4ca330881c506c5200dfa69851/govuk_frontend_jinja/flask_ext.py#L22

Raises KeyError: 'extensions'

pip freeze | grep Flask
Flask==2.0.2

I think this is because there are no default Jinja extensions in Flask as of pallets/flask@81ba6c2 in accordance with https://github.com/pallets/jinja/issues/1203

Probably need to add something like:

if 'extensions' not in jinja_options:
    jinja_options['extensions'] = []