Hi,
I've followed the instructions to the letter but it keep throwing the Typeerror you see in the subject.
Here is a copy paist of my views :
from django.shortcuts import render
from django.http import HttpResponse
from django import template
import datetime
def index(request):
return HttpResponse("Hello Django")
def today_is(request):
now = datetime.datetime.now()
t = template.loader.get_template('blog/datetime.html')
c = template.Context({'now': now})
html = t.render(c)
return HttpResponse(html)
and here is a copy paist of my template:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Current Time</title>
</head>
<body>
{#This is a comment #}
{check the existence of now variable in the template using if tag #}
{% if now %}
<p>Current date and time is {{ now }}</p>
{% else %}
<p>now variable is not available</p>
{% endif %}
</body>
</html>
Any help would be greatly appreciated.
Thanks
Allon