Answer the question
In order to leave comments, you need to log in
How to make a pass-through element with dynamic data in Django?
Hello.
Task: to make a cross-cutting banner on the site that can be easily changed (via the admin panel).
How I'm trying to decide:
1) I did: model/url/view/template for a page with a banner. (like a normal page renderer).
2) in the banner template, I specified dynamic data by type
# код внутри шаблона banner.html
<p>{{ banner.img.url }}</p>
<p>{{ banner.link }}</p>
{% include 'faceset/banner.html' %}
<p></p>
<p></p>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question