在Django中为其创建应用程序后未出现消息

我创建了一个名为Marketing app的应用程序,该应用程序可自定义要在网站页面顶部编写的消息。我的问题是,配置完所有内容后,这些消息没有显示,我也不知道为什么

这是Marketing App的模型

class MarketingMessage(models.Model):
    message = models.CharField(max_length=120)
    active = models.BooleanField(default=False)
    featured = models.BooleanField(default=False)
    timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
    updated = models.DateTimeField(auto_now_add=False, auto_now=True)
    start_date = models.DateTimeField(
        auto_now_add=False, auto_now=False, null=True, blank=True)
    end = models.DateTimeField(
        auto_now_add=False, auto_now=False, null=True, blank=True)

    def __str__(self):
        return str(self.message[:12])

这是核心应用程序的视图

from marketing.models import MarketingMessage

class HomeView(ListView):
    model = Item
    paginate_by = 10
    template_name = "home.html"
    marketing_message = MarketingMessage.objects.all()[0]

这是模板

{% if marketing_message %}

<div class="alert alert-light alert-top-message" role="alert"style="margin-bottom: 0px; border-radius: 0px; text-align: center;padding-top:80px">
    <div class="container">
    <h3>{{ marketing_message.message }}</h3>
    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
    </button>
    </div>
</div>
{% endif  %}

这是市场营销的管理员

from django.contrib import admin
from .models import MarketingMessage
# Register your models here.


class MarketingMessageAdmin(admin.ModelAdmin):
    class Meta:
        model = MarketingMessage


admin.site.register(MarketingMessage, MarketingMessageAdmin)