diff --git a/sample_project/templates/base.html b/sample_project/templates/base.html index 93f7d4e79..963fbff66 100644 --- a/sample_project/templates/base.html +++ b/sample_project/templates/base.html @@ -4,17 +4,43 @@ {% block content %} {% if not user.is_authenticated %} +
-

Username:

-
admin
+

Login:

+
admin / {% password %}

-

Current password:

-
{% password %}
-
-

Startup time:

-
{% startup %}
+

This instance will be redeployed in

+

         
diff --git a/sample_project/templatetags/sample_project.py b/sample_project/templatetags/sample_project.py index dcf344c59..ed06a3375 100644 --- a/sample_project/templatetags/sample_project.py +++ b/sample_project/templatetags/sample_project.py @@ -1,3 +1,4 @@ +import datetime import pathlib from django import template @@ -10,5 +11,7 @@ def password(): @register.simple_tag -def startup(): - return pathlib.Path("/tmp/startup.txt").read_text() +def teardown(): + date = datetime.datetime.fromisoformat(pathlib.Path("/tmp/startup.txt").read_text()) + until = date + datetime.timedelta(hours=6) + return until