flask_test / app /app.py
fschwartzer's picture
Create app.py
a762c55 verified
from flask import Flask, render_template_string
app = Flask(__name__)
@app.route('/')
def index():
return render_template_string('''
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>avalia.se</title>
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Quicksand', sans-serif;
text-align: center;
}
.app-link {
display: inline-block;
margin: 10px;
text-decoration: none;
}
.app-image {
width: 150px;
height: auto;
border: 2px solid transparent;
transition: border 0.3s;
}
.app-image:hover {
border: 2px solid #007bff;
}
.logo {
width: 200px;
height: auto;
margin: 20px 0;
}
</style>
</head>
<body>
<a href="/"><img src="images_avalia-removebg-preview.PNG" class="logo"></a>
<div>
<a href="/gradio_app_1" class="app-link">
Gradio App 1
</a>
<a href="/gradio_app_2" class="app-link">
Gradio App 2
</a>
<a href="/streamlit_app" class="app-link">
Streamlit App
</a>
</div>
</body>
</html>
''')
@app.route('/gradio_app_1')
def gradio_app_1():
return render_template_string('''
<html>
<head>
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Quicksand', sans-serif;
text-align: center;
}
iframe {
border: none;
width: 100%;
height: 800px;
}
.logo {
width: 200px;
height: auto;
margin: 20px 0;
}
</style>
</head>
<body>
<a href="/"><img src="images_avalia-removebg-preview.PNG" alt="AVALIA.SE" class="logo"></a>
<h1>Gradio App 1</h1>
<iframe src="https://fschwartzer-rl-2.hf.space"></iframe>
</body>
</html>
''')
@app.route('/gradio_app_2')
def gradio_app_2():
return render_template_string('''
<html>
<head>
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Quicksand', sans-serif;
text-align: center;
}
iframe {
border: none;
width: 100%;
height: 800px;
}
.logo {
width: 200px;
height: auto;
margin: 20px 0;
}
</style>
</head>
<body>
<a href="/"><img src="images_avalia-removebg-preview.PNG" alt="AVALIA.SE" class="logo"></a>
<h1>Gradio App 2</h1>
<iframe src="https://fschwartzer-bens-moveis-vision.hf.space"></iframe>
</body>
</html>
''')
@app.route('/streamlit_app')
def streamlit_app():
return render_template_string('''
<html>
<head>
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Quicksand', sans-serif;
text-align: center;
}
iframe {
border: none;
width: 100%;
height: 800px;
}
.logo {
width: 200px;
height: auto;
margin: 20px 0;
}
</style>
</head>
<body>
<a href="/"><img src="images_avalia-removebg-preview.PNG" alt="AVALIA.SE" class="logo"></a>
<h1>Streamlit App</h1>
<iframe src="https://fschwartzer-geo-dash-tabs.hf.space"></iframe>
</body>
</html>
''')
if __name__ == '__main__':
app.run(debug=False, use_reloader=False)