Python 图像被破解

Python 图像被破解,python,django,django-templates,Python,Django,Django Templates,图像被破解。 我在photo.html中写道 {% extends "registration/accounts/base.html" %} {% block content %} <div class="container"> <h2 class="page-header">{{ photos.title }}</h2> <div class="row"> <div class="col-xs

图像被破解。 我在photo.html中写道

{% extends "registration/accounts/base.html" %}
  {% block content %}
  <div class="container">
      <h2 class="page-header">{{ photos.title }}</h2>
      <div class="row">
        <div class="col-xs-4">
          <img class="img-responsive" src="/media/{{ photos.image }}">
        </div>
      </div>
      <a class="btn btn-primary" href="{% url 'accounts:upload' photo.id %}">UPLOAD</a>
  </div>
{% endblock %}
{%extends“registration/accounts/base.html”%}
{%block content%}
{{photos.title}
{%endblock%}
我不知道为什么。我怎样才能修好它?“img标签”有错吗

“cracked”的意思是

检查当
DOM
就绪时生成的图像url

  • 单击断开的图像图标
  • 右键单击>检查图元
  • 检查url
如果url是正确的。。检查网络请求面板。。确认图像是否已加载


他们可能有一些错误。。在服务器上找不到类似的映像。。或CORS问题

您的HTML标记应该如下所示:

<img class="img-responsive" src="photo.image.url">

照片。图像
引用图像文件本身,而不是图像的url。 您需要使用图像url
photo.image.url

<img class="img-responsive" src="{{ photos.image.url }}">


可能是你的
class=“img responsive”
?你说的破解是什么意思?@zagordniyolexiy thx,你的评论。那么,我应该怎么做才能修复它?@evansumrithi thx,你的评论。我添加了情况信息。你的图像文件路径不正确,浏览器找不到它们。thx你的评论。我检查了url,所以我发现src是错误的。图像在图像(子应用程序名称)/图像中,所以我想指定目录,但我不知道如何指定。请告诉我怎么走?没有;无法准确获取文件夹结构。。但是,您可以使用src前面的
。/
返回一个目录。。比如
src=“../media/{{{photos.image}}”