[問題] Django extends
請教各位 我使用django 1.4a1 版本 ubuntu 11.10
呼叫流程 index.html extends test.html,而在test.html extends base.html,
而我呼叫 index.html時,大致上是正常,
但是在chrome與 firefox <body>與<title>之間會跑出不知道是什麼(好像髒髒的東西),
不知道發生什麼事情?
chrome 檢查元素:
<html><head>(略..)</head>
<body>?<title>test</title></body></html>
圖: http://ppt.cc/sY28
檔案: http://ppt.cc/-3P;
url.py :
from django.conf.urls.defaults import patterns, include, url
urlpatterns = patterns('test.views',
(r'^$', 'index'),
)
views.py:
from django.shortcuts import render_to_response
def index(request):
return render_to_response('index.html')
{ TEMPLATE_DIRS path }/index.html:
{% extends "showcode/test.html"%}
檔案: http://ppt.cc/vJYt
{ TEMPLATE_DIRS path }/test.html:
{% extends "base.html" %}
檔案: http://ppt.cc/BF06
{ TEMPLATE_DIRS path }/base.html:
<html><title>test</title></html>
檔案: http://ppt.cc/A;X3
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.135.10.166
→
05/29 02:33, , 1F
05/29 02:33, 1F
→
05/29 02:33, , 2F
05/29 02:33, 2F
→
05/29 02:34, , 3F
05/29 02:34, 3F
→
05/29 12:31, , 4F
05/29 12:31, 4F
→
05/29 12:32, , 5F
05/29 12:32, 5F
→
05/29 12:39, , 6F
05/29 12:39, 6F
→
05/30 02:34, , 7F
05/30 02:34, 7F
→
05/30 02:34, , 8F
05/30 02:34, 8F