Flask | pre- añadimos la plantilla

This commit is contained in:
fenix 2024-02-13 15:48:42 +01:00
parent 7bfa1bc9da
commit 88c478081a
3 changed files with 20 additions and 4 deletions

2
app.py
View File

@ -4,7 +4,7 @@ app = Flask(__name__)
@app.route("/")
def home():
return "Hello, World!"
return "HOLA, World!"
if __name__ == "__main__":
app.run(debug=True)

View File

@ -1,5 +1,5 @@
def do_twice(func):
def wrapper_do_twice():
func()
func()
def wrapper_do_twice(*args, **kwargs):
func(*args, **kwargs)
func(*args, **kwargs)
return wrapper_do_twice

16
templates/base.html Normal file
View File

@ -0,0 +1,16 @@
{# templates/base.html #}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{{ title }}</title>
</head>
<body>
<h1>Welcome to {{ title }}!</h1>
</body>
</html>