我正在尝试在我的主页上显示嵌入保存的视频,但由于某些原因,只创建了object
类div,图标本身及其标题不会显示。
这是我的models.py
class HomePage(Page):
body = RichTextField(blank=True)
content_panels = Page.content_panels + [
FieldPanel('body', classname="full"),
# InlinePanel('home_images', label="Gallery images"),
InlinePanel('video')
]
class VideoBasedModel(models.Model):
page = ParentalKey(HomePage, on_delete=models.CASCADE, related_name='video')
video = models.ForeignKey(
'wagtail_embed_videos.EmbedVideo',
verbose_name="Video",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+',
)
panels = [
EmbedVideoChooserPanel('video')
]
template_name = 'home/homepage.html'
这是我的home_page.html
{% block list %}
<div class="lists">
<div> <!-- List Nunti -->
<div class="title">
<hr />
<h3>Nunti</h3>
<hr />
</div>
{% for item in page.video.all %}
<div class = 'object'>
{% video item.video 'small' %}
</div>
{% endfor %}
</div>
</div>
{% endblock %}
我错过了什么,django-embed-video是否有默认模板,嵌入视频的代码需要去哪里?