Answer the question
In order to leave comments, you need to log in
How to connect your library to the template?
There is a self-written library for your project.
......
class Upload:
....
def get_files(self, folder_name, id):
path = self.get_path(folder_name, id)
.......
return images
else:
return False
..............
{% for new in news %}
<div class="news">
<div class="news-title">{{ new.title }}</div>
{{ new.short_text }}
{{ Upload.ge_files('news', new.id}}
{% endfor %}
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