已上传 files/chunks 正在消失

Uploaded files/chunks are disappearing

我正在尝试使用 resumable.js 和 django 设置大型文件上传系统。前端都已正确配置,对于我正在使用的 django 端 django-resumable。我正在使用一个非常基本的视图来处理上传:

from resumable.views import ResumableUploadView
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured

class UserFileUploadView(ResumableUploadView):
    @property
    def chunks_dir(self):
        chunks_dir = getattr(settings, 'MEDIA_ROOT', None)
        if not chunks_dir:
            raise ImproperlyConfigured(
                'You must set settings.MEDIA_ROOT')
        return chunks_dir

当我上传文件时,似乎上传正确,但我在 MEDIA_ROOT 目录中看不到块或完整的文件。
如果我取消上传,服务器有时会提到一个 ConnectionAbortedError 后面跟着几个 AttributeErrors,并且开始新的上传会忽略所有上传的块。如果我允许上传完成,我无法再次上传文件,直到页面刷新。

在查看 django-resumable 代码时,我理解了它应该如何运行,但看不出有任何不应该运行的原因。有什么方法可以确定块是否正在上传,如果正在上传,它们会去哪里?

原来是路由的问题。我正在使用 JSON Web Tokens 进行身份验证,但上传视图的路径使用了 login_required(),这似乎不起作用。我似乎也错误地提供了我的 JWT,使用 token: 字段而不是 Authentication: header.