Flask | pre- añadimos la plantilla
This commit is contained in:
parent
7bfa1bc9da
commit
88c478081a
2
app.py
2
app.py
|
@ -4,7 +4,7 @@ app = Flask(__name__)
|
|||
|
||||
@app.route("/")
|
||||
def home():
|
||||
return "Hello, World!"
|
||||
return "HOLA, World!"
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue