S
S
s_katala2018-06-10 15:11:36
Django
s_katala, 2018-06-10 15:11:36

Block content django?

Help me to understand!
There is a user profile page.
in it

{% block content %}
   <div> Шапка </div>
  {% block one %}
   <div> Контент </div>
  {% endblock %}
{% endblock %}

There is also a profile settings page.
I want the summer to never end (Joke)
So that when you go to the settings page, the content changes, but I don’t want to create a new page!
how to make a type
{% block content %}
   <div> Шапка </div>
 {% block one %}
   <div> Контент </div>
  {% endblock %}
  {% block setting %}
   <div> Контент </div>
    {% endblock %}
{% endblock %}

That is, when we go to the profile, we see the one block, when we go to setting, we see the setting
But then what to write in ulr?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Web Dentist, 2018-06-10
@kgb_zor

For starters, you can

{% if request.path == 'settings' %}

ваш блок

{% endif %}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question