launch-kit-gen / app.py
duqing2026's picture
fix: resolve Jinja2/Vue conflict and localize static assets
ae1a358
raw
history blame contribute delete
578 Bytes
import os
from flask import Flask, render_template, send_from_directory
app = Flask(__name__)
# 配置 Jinja2 使用不同的定界符,避免与 Vue.js 的 {{ }} 冲突
app.jinja_env.variable_start_string = '[['
app.jinja_env.variable_end_string = ']]'
app.jinja_env.block_start_string = '[%'
app.jinja_env.block_end_string = '%]'
@app.route('/')
def index():
return render_template('index.html')
@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)