0

Before I used to load just part of page in django. Usually it used to be a text that I did not want change often, but I forgot how to do it, now I cannot find it.

I have two html docs, in one I want to load other, can you tell me where I made a mistake?

Text to load text_story.html

<p>Some text!</p>

Page where is loaded text about.html

{% extends "base.html" %}
{% load static %}

{% load "parts/text_story.html" %}

{% block content %}


{% endblock content %}

Thanks in advance!

1 Answer 1

3

You're looking for {% include %}:

{% extends "base.html" %}
{% load static %}

{% block content %}

{% include "parts/text_story.html" %}

{% endblock content %}
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks ! It works, but it needs to be inside of {% block content %}.
@project.py you're correct, I missed that part. Fixed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.