add auto datetime and year
This commit is contained in:
parent
6d4f77a92a
commit
64fba789d0
@ -1,5 +1,6 @@
|
|||||||
from flask import Flask, render_template
|
from flask import Flask, render_template
|
||||||
from flask_sqlalchemy import SQLAlchemy
|
from flask_sqlalchemy import SQLAlchemy
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
|
||||||
app = Flask(__name__, static_folder='static', static_url_path='')
|
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("/")
|
||||||
@app.route("/home")
|
@app.route("/home")
|
||||||
def home():
|
def home():
|
||||||
|
|||||||
@ -153,7 +153,7 @@
|
|||||||
|
|
||||||
<!-- Copyright -->
|
<!-- Copyright -->
|
||||||
<div class="text-center p-3" style="background-color: rgba(0, 0, 0, 0.2);">
|
<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>
|
<a class="text-dark" href="http://klintorg.ru">klintorg.ru</a>
|
||||||
</div>
|
</div>
|
||||||
<!-- Copyright -->
|
<!-- Copyright -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user