add auto datetime and year

This commit is contained in:
Noretsa 2023-11-15 13:57:17 +03:00
parent 6d4f77a92a
commit 64fba789d0
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,6 @@
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
app = Flask(__name__, static_folder='static', static_url_path='')
@ -30,6 +31,11 @@ menu = [
]
@app.context_processor
def inject_now():
return {'now': datetime.utcnow()}
@app.route("/")
@app.route("/home")
def home():

View File

@ -153,7 +153,7 @@
<!-- Copyright -->
<div class="text-center p-3" style="background-color: rgba(0, 0, 0, 0.2);">
© {{ moment().format('YYYY') }} Copyright:
© {{ now.year }} Copyright:
<a class="text-dark" href="http://klintorg.ru">klintorg.ru</a>
</div>
<!-- Copyright -->