yandex_lyceum/WEB. HTML/server.py
2022-03-21 18:15:33 +07:00

41 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from flask import Flask, url_for
app = Flask(__name__)
@app.route('/')
def index():
return "Миссия Колонизация Марса"
@app.route('/index')
def gimn():
return 'И на Марсе будут яблони цвести!'
@app.route('/promotion')
def promo():
return '</br>'.join(['Человечество вырастает из детства.',
'Человечеству мала одна планета.',
'Мы сделаем обитаемыми безжизненные пока планеты.',
'И начнем с Марса!', 'Присоединяйся!'])
@app.route('/image_mars')
def img():
return f"""<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Привет, Марс!</title>
</head>
<body>
<h1>Жди нас, Марс!</h1>
<img href="{url_for('static', filename='img/planet.jpg')}">
<br>Вот она какая, красная планета.</br>
</body>
</html>"""
if __name__ == '__main__':
app.run(port=8080, host='127.0.0.1')