add date
This commit is contained in:
		
							
								
								
									
										5
									
								
								app.py
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								app.py
									
									
									
									
									
								
							| @ -34,6 +34,11 @@ app = Flask(__name__) | ||||
| app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1) | ||||
| app.secret_key = 'eng5iikeiwah3lae4idoo0woh4eiy6Th' | ||||
|  | ||||
| @app.context_processor | ||||
| def get_date(): | ||||
|     date = datetime.now() | ||||
|     return { "now": date.strftime("%Y-%m-%d") } | ||||
|  | ||||
| @app.route('/', methods = ['GET', 'POST']) | ||||
| def index(): | ||||
|     if request.method == 'POST': | ||||
|  | ||||
| @ -16,7 +16,7 @@ | ||||
|     {% block content %}{% endblock %} | ||||
| </div> | ||||
| <footer class="w3-container w3-border-top w3-light-grey w3-border-blue-grey w3-center" style="position: fixed; bottom: 0; width: 100vw; height: auto"> | ||||
|     {% block footer %}<div class="w3-small">{{ request.base_url }}</div>{% endblock %} | ||||
|     {% block footer %}<div class="w3-small">{{ now }} - {{ request.base_url }}</div>{% endblock %} | ||||
| </footer> | ||||
| </body> | ||||
| </html> | ||||
		Reference in New Issue
	
	Block a user