Spaces:
Sleeping
Sleeping
| 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 = ']]' | |
| 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 | |
| def send_static(path): | |
| return send_from_directory('static', path) | |
| if __name__ == '__main__': | |
| app.run(host='0.0.0.0', port=7860) | |