duqing2026's picture
feat: enhance functionality with templates, import/export, and local assets
81ea66c
raw
history blame contribute delete
726 Bytes
from flask import Flask, render_template, send_from_directory
import os
app = Flask(__name__, static_folder='static', template_folder='templates')
# Configure Jinja2 to use different delimiters to avoid conflict with 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.jinja_env.comment_start_string = '[#'
app.jinja_env.comment_end_string = '#]'
@app.route('/')
def index():
return render_template('index.html')
@app.route('/static/<path:path>')
def serve_static(path):
return send_from_directory('static', path)
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=7860)