I have an assignment to construct a simple webpage with flask. I've gotten it working and have everything I need so far in my templates. What I can't figure out is how to display the date time on my pages. Do I put the date time in the templates individually, or put it in the base python code? My instructions say to just use the standard python date time function. But it isn't displaying when i test my page.
from flask import Flask
from flask import render_template
import datetime
app = Flask(__name__)
@app.route('/')
def index():
return show_home()
def show_home():
return render_template('index.html')
@app.route('/ingredients/')
def ingredients():
return show_ingredients()
def show_ingredients():
return render_template('ingredients.html')
@app.route('/cooking_instructions/')
def cook_it():
return show_cook_it()
def show_cook_it():
return render_template('cooking_instructions.html')
datetime.now()and display it in one of your templates.