Spaces:
Sleeping
Sleeping
import os | |
import requests | |
import json | |
from io import BytesIO | |
from flask import Flask, jsonify, render_template, request, send_file | |
app = Flask(__name__) | |
def index(): | |
# Basic HTML string | |
html = ''' | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Dynamic HTML Page</title> | |
<style> | |
body { font-family: Arial, sans-serif; margin: 40px; } | |
.container { max-width: 800px; margin: 0 auto; } | |
.highlight { background-color: #f0f0f0; padding: 20px; } | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<h1>Welcome to Flask</h1> | |
<div class="highlight"> | |
<p>This HTML was rendered directly from a string!</p> | |
</div> | |
</div> | |
</body> | |
</html> | |
''' | |
return html | |
if __name__ == "__main__": | |
app.run(host="0.0.0.0", port=7860) | |