Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
564 B
1
Indexable
Never
from flask import Flask, render_template
import datetime

app = Flask(__name__)

@app.route('/')
def index():
  date = datetime.datetime.now()
  h = date.hour
  m = date.minute
  s = date.second
  return render_template("index.html", heure = h, minute = m, seconde = s)

app.run(debug=True,port=5001)


<!doctype html>
<html lang="fr">
	<head>
		<meta charset="utf-8">
		<title>Ma page</title>
	</head>
	<body>
	  <h1>Mon super site</h1>
	  <p>Tout fonctionne parfaitement, il est {{heure}}h {{minute}} et {{seconde}}</p>
	</body>
</html>