Tengo un sitio llamado prueba que contiene:
manage.py
settings.py
urls.py
views.py
y un directorio llamado templates
En settings.py tengo configurado TEMPLATE_DIRS a la ruta absoluta del directorio templates:
Código HTML:
TEMPLATE_DIRS = (
'/home/user/prueba/templates',
)
base.html
Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <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>
Código HTML:
{ % extends "base.html" %}
{ % block title %}Future time{ % endblock %}
{ % block content %}
<p>In {{ hour_offset }} hour(s), it will be {{ next_time }}.</p>
{ % endblock %}
Código HTML:
from django.shortcuts import render_to_response
import datetime
def hours_ahead(request, offset):
offset = int(offset)
dt = datetime.datetime.now() + datetime.timedelta(hours=offset)
return render_to_response('hours_ahead.html', {'hour_offset': offset, 'next_time': dt})
Código HTML:
{ % extends "base.html" %}
{ % block title %}The current time{ % endblock %}
{ % block content %}
<p>It is now Sept. 7, 2011, 9:13 p.m..</p>
{ % endblock %}
¿Qué puede estar pasando y cúal sería la forma de solucionarlo?
Gracias


Este tema le ha gustado a 2 personas