Commit 941a39e3 authored by Jose Luis Bautista's avatar Jose Luis Bautista
parent 7b860f35
......@@ -22,7 +22,8 @@
</ul>
</nav>
<h2> {% block header %} {% endblock %} </h2>
<h2 align = 'right'> {% block header %} {% endblock %} </h2>
<hr class="dotted">
</head>
<body>
{% block body %}
......
......@@ -14,7 +14,7 @@
<h1> Hello! What is your name? </h1>
<form action = "home/" method = "POST">
<form method = "POST">
{% csrf_token %}
{{ form }}
<input type="submit" name="submit" id = "submit" value = "Submit Name">
......
......@@ -3,3 +3,8 @@
{% block title %}Today{% endblock %}
{% block header %}Today{% endblock %}
{% block body %}
<h1> {{date}} </h1>
{% endblock %}
\ No newline at end of file
from django.shortcuts import render
from django.http import HttpResponse
from django.views import View
from datetime import datetime
from .forms import home, profile, key, this_week, today
def page_home(request):
......@@ -21,4 +22,13 @@ def page_this_week(request):
return render(request, 'this_week.html',{'profile': profile})
def page_today(request):
return render(request, 'today.html',{'profile': profile})
# return HttpResponse("<h1>Hello, world !</h1>")
# Some Date Object, for example a default generated by datetime
myDate = datetime.now()
# Give a format to the date
# Displays something like: Aug. 27, 2017, 2:57 p.m.
formatedDate = myDate.strftime("%m-%d-%A")
# Do something with the formatted date
return render(request, 'today.html', {'date': formatedDate})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment