Reputation: 131
I'm new in Django framework and I'm trying to follow step to step the official django project's documentation.
In templating i have a file HTML called base.html
and following code:
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>{ % block title %}{ % endblock %}</title>
</head>
<body>
<h1>My helpful timestamp site</h1>
{ % block content %}{ % endblock %}
{ % block footer %}
<hr>
<p>Thanks for visiting my site.</p>
{ % endblock %}
</body>
</html>
and other file called 'hour_ahead.html" with following code:
{ % extends "base.html" %}
{ % block title %}Hours ahead{ % endblock %}
{ % block content %}
<p>In {{ plus.offset }} Hours. It will be {{plus.dt}} .</p>
{ % endblock %}
Inside view.py, this is the method that implements the template:
def hours_ahead(request, offset):
offset = int(offset)
dt = datetime.datetime.now() + datetime.timedelta(hours=offset)
c = {'plus':{'offset':offset, 'dt':dt}}
return render_to_response('hour_ahead.html',c)
Same all correct, but when I want view this page with Chrome, I'm watching this:
{ % extends "base.html" %} { % block title %}Hours ahead{ % endblock %} { % block content %} In 1 Hours. It will be Nov. 12, 2012, 12:21 a.m. .
{ % endblock %}
My question is: How can I hide all tags {% ...%}
in front end? and Because Don't print it the "hours ahead" title ?
thanks...
Upvotes: 2
Views: 201