15 lines
344 B
Python
15 lines
344 B
Python
from flask import Flask, render_template
|
|
import random
|
|
import datetime
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
@app.route('/')
|
|
def home():
|
|
random_number = random.randint(1, 10)
|
|
current_year = datetime.datetime.now().year
|
|
return render_template('index.html', num=random_number, year=current_year)
|
|
|
|
if __name__ == "__main__":
|
|
app.run(debug=True) |