:이 질문에 대해 오도하지 마십시오. 제 변경 사항은 제대로 작동하지 않는 곳에서 내 잘못이었습니다. 나는이 프로젝트의 모든 것을 혼란스럽게 (not a smart idea
)라고 불렀다. 나는 다른 프로젝트에서 변경 작업을하고 있었다. 좋은 stackoverflow 사람들에게 사과한다. 나는 오도한다.템플릿 상속이 실패하는 이유는 무엇입니까?
나는 기본 템플릿을 내가 여기 상속 public_base.html
<!doctype html>
<!-- [if IE ]> <html class="no-js"> <![endif] -->
<head>
<!-- favicon for web browser and smartphones -->
<link rel="icon" href="{{ STATIC_URL }}images/img.png" type="image/x-png">
<link rel="apple-touch-icon" href="{{ STATIC_URL }}img/apple-touch-icon.png">
<!-- Google Fonts -->
<link href='http://fonts.googleapis.com/css?family=Homenaje|Molengo' rel='stylesheet' type='text/css'>
<!-- CSS Section -->
<link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}maincss/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}maincss/impress.css">
<link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}maincss/style.css">
<link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}maincss/impression.css">
<title>{% block title %}F4L | Have it easy{% endblock %}</title>
</head>
<body lang="en">
<div id="container">
{% load smartmin %}
<div id="header"> <!-- Header -->
<div id="logo">
<a href="{% url homepage %}">
<img src="{{ STATIC_URL }}img/logo.jpg" class="" alt="" />
</a>
</div>
<div id="menu">
<ul>
{% if perms.restaurant_detail.restaurant_detail.create %}
<li><a href="#">Join F4L</a></li>
{% endif %}
<li><a href="#">FAQ</a></li>
<li><a href="#">contact</a></li>
<li><a href="#">about us</a></li>
{% if request.user.is_authenticated %}
<li><a href="{% url users.user_logout %}">logout</a></li>
{% else %}
<li><a href="{% url users.user_login %}">login</a></li>
{% endif %}
</ul>
</div>
</div> <!-- End Header -->
<div style="clear: both;"></div>
<div id="main"> <!-- Main -->
{% block main-contents %}
<p>jrneflkwnel</p>
{% endblock %}
</div>
</div>
, home.html
{% extends "public_base.html" %}
{% block main-contents %}
<p>This is not Working.</p>
{% endblock main-contents %}
을 가지고 있지만이 기본적으로 home.html
의 내용은로드되지 않은, 전혀 작동하지 않습니다. 무엇이 이것을 일으킬 수 있습니까?
그런데 변화가 없었습니다 ... –
두 템플릿이 모두'templates' 폴더의 루트에 있습니까? –
아니요,'home.html'은 .. 다른 디렉토리에 있습니다 ... –