Trae Assistant
Fix: Resolve Jinja2/Vue conflict by changing Flask delimiters to [[ ]]
ec34ee8
raw
history blame contribute delete
711 Bytes
from flask import Flask, render_template, send_from_directory
import os
import logging
app = Flask(__name__)
# Change Jinja2 delimiters to avoid conflict with Vue.js
# Vue uses {{ }}, so we change Flask/Jinja2 to use [[ ]]
app.jinja_env.variable_start_string = '[['
app.jinja_env.variable_end_string = ']]'
@app.route('/')
def index():
try:
return render_template('index.html')
except Exception as e:
app.logger.error(f"Error rendering template: {str(e)}")
return f"Internal Server Error: {str(e)}", 500
@app.route('/static/<path:path>')
def send_static(path):
return send_from_directory('static', path)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=7860)