python - 同行重置 Django 连接

标签 python django

当我尝试在模板中呈现视频文件时遇到问题

<video autoplay muted>
            <sourcesrc="{{ video.oblozka_video_file.url }}" poster="{{ video.oblozka_video_preview.url }}" type="video/mp4">
        </video>

这是我异常的回溯

    Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
    self.finish_response()
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 128, in finish_response
    self.write(data)
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 217, in write
    self._write(data)
  File "/usr/lib/python2.7/socket.py", line 328, in write
    self.flush()
  File "/usr/lib/python2.7/socket.py", line 307, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 104] Connection reset by peer
[19/May/2017 09:07:06] "GET /media/studios_videos/video/3/2/3e2df999-c34a-439b-b69a-94b4977a3d80.mp4 HTTP/1.1" 500 59
- Broken pipe from ('192.168.1.5', 55300)

最佳答案

尝试在您的 settings.py 中添加您的 SITE_URL

即如果您在 http://127.0.0.1:8000 中运行

SITE_URL = "http://127.0.0.1:8000"

关于python - 同行重置 Django 连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44066022/

相关文章:

python - Django 管理命令参数

python - 创建默认值为零 (0) 的 defaultdict

javascript - 错误 : Templates should only be responsible for mapping the state to the UI. 避免在模板中放置有副作用的标签,例如 &lt;script&gt;

python - 使用 Werkzeug 和 Jinja2 的上下文处理器

python - Django Celery 设置导入问题

python - 为什么我不应该将 django key 存储在 settings.py 中

django - Cappuccino Django 集成

python - JWT 与 Django 集成

python - 捕获屏幕并找到引用图像

python - 重新调整视频帧之间的时间差