首页 > 解决方案 > 我应该怎么做才能让我的照片出现在 Django only safari 中?

问题描述

我制作了我的macbook磁盘格式。在格式之后,我包含了我的项目。但是,照片不会显示在项目页面上。如果我去一个特定的产品,(单页)这是一张照片。标志也是可见的。图片不只是集体展示给我。

Safari 没有看到“css/mdb.min.css”

也许我没有安装任何东西?之前,一切正常。

这里图片展示 product.html

{% extends 'base.html' %}
{% load static %}
{% block title %} {{ product.name }} - PVB {% endblock %}
{% block content %}

<main class="mt-5 pt-4">
    <div class="container dark-grey-text mt-5">
        <!--Grid row-->
      <div class="row wow fadeIn">
          <!--Grid column-->
        <div class="col-md-6 mb-4">
          <img src="{{ product.photo.url }}" class="img-fluid" alt="">
        </div>
          <!--Grid column-->
          <div class="col-md-6 mb-4">
              <!--Content-->
              <div class="p-4">
                <div>
                  <h2>{{product.product_name}}</h2><hr>
                  <h5><p>Description</p></h5>
                  <p class="text-justify"><h6>{{product.description}}</h6></p>
                  <p class="text-justify"><h6>Weight: {{product.weight}}g</h6></p><hr>
                    </div>
                </div>
            </div>
        </div>
      <hr>
    </div>
  </main>

{% endblock %}

这里没有 products.html

 {% extends 'base.html' %}
    {% load static %}
    {% block title %} Offer - PVB {% endblock %}
    {% block content %}








      <section id="marks">
        <div class="container">
          <header>
            <h1>Our Offer</h1>
          </header>
        </div>
      </section>


      <!-- Offers -->
            <section class="text-center mb-4 py-4">
              <div class="container">
                <div class="row">
                    {% if products %}
                    {% for product in products %}

                <!--Grid column-->
                <div class="col-lg-3 col-md-6 mb-4">
                  <div class="card">
                    <div class="view overlay">
                      <img src="{{ product.photo.url }}" class="card-img-top" alt="">
                      <a href="{% url 'product' product.id %}">
                        <div class="mask rgba-white-slight"></div>
                      </a>
                    </div>
                    <div class="card-body text-center">
                        <h6 class="grey-text">{{ product.category }}</h6>
                      <h5>
                        <strong>
                          <a href="{% url 'product' product.id %}" class="text-product">{{ product.product_name }}</a>
                        </strong>
                      </h5>
                    </div>
                  </div>
                </div>
                <!--Grid column-->

                {% endfor %}
                {% else %}
                  <div class="col-sm-12 sm-12">
                    <p>No Products Available</p>
                  </div>
                {% endif %}




              </div>
            </div>
            </section>

    {% endblock %}

标签: pythondjangodjango-modelsdjango-templatesdjango-views

解决方案


检查您的媒体文件夹,可能是空的


推荐阅读