We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 852eeb7 commit c3aff71Copy full SHA for c3aff71
1 file changed
src/web_interface/app.py
@@ -6,8 +6,22 @@
6
import config
7
8
9
+class ExtendedAutoEscapeFlask(Flask):
10
+ AUTOESCAPE_EXTENSIONS = (
11
+ '.j2',
12
+ '.jhtml',
13
+ '.jinja',
14
+ '.jinja2',
15
+ )
16
+
17
+ def select_jinja_autoescape(self, filename):
18
+ if filename and filename.endswith(self.AUTOESCAPE_EXTENSIONS):
19
+ return True
20
+ return super().select_jinja_autoescape(filename)
21
22
23
def create_app():
- app = Flask(__name__)
24
+ app = ExtendedAutoEscapeFlask(__name__)
25
app.config.from_object(__name__)
26
app.config['SECRET_KEY'] = os.urandom(24)
27
_add_config_to_app(app)
0 commit comments