2016-10-17 3 views
0

좋아요. index.html 파일에서 제외 된 info.html이라는 파일이있는 index.html 파일이 있습니다.하지만 현재 제대로 작동하지 않습니다.Django가 템플릿 문제를 확장합니다.

index.html을

<body> 

    {% include "home/quote.html" %} 

    {% include "home/intro.html" %} 

    {% block content %} 
    {% endblock %} 

    {% include "home/projects.html" %} 

    {% include "home/goals.html" %} 

</body> 

info.html

{% extends "home/index.html" %} 

{% block content %} 

<section class="info-section"> 

    <div class="info-section_content"> 

     {% include "home/includes/info-content.html" %} 

    </div> 

</section> 

{% endblock %} 
+0

어떻게 작동하지 않습니까? 그리고 어떻게 이것을 렌더링하고 있습니까? –

답변

1

Essy 수정 : 여기에 내 코드입니다!

apps 디렉토리의 views.py에서 부모 파일 (index.html)을 렌더링 했으므로 이제 자식 파일 (info.html)을 렌더링하도록 전환했으며 이제는 작동합니다.

0

내가 확실히 알고 프로젝트에 대한 몇 가지 자세한 정보가 필요 것입니다,하지만 난 당신이 여기에 적절한 네임 스페이스를 참조하고 있는지 확인하십시오 것 :

예를 들어
{% extends "home/index.html" %} 

경로는 템플릿과 같은 경우를 /home/something/info.html 또는 templates/something/home/info.html이 문제 일 수 있습니다.

관련 문제