django - Whitenoise.storage.MissingFileError : The JS file 'drf-yasg\redoc\redoc.min.js' references a file which could not be found

标签 django django-rest-framework drf-yasg whitenoise

我尝试在正在使用 Django/Django REST Framework 的 API 项目上收集静态文件,但在控制台上收到此错误。错误的原因可能是什么?

加注已处理 Whitenoise.storage.MissingFileError: 无法使用 找到文件“drf-yasg/redoc/redoc.standalone.js.map”。

JS 文件“drf-yasg\redoc\redoc.min.js”引用了一个无法找到的文件: drf-yasg/redoc/redoc.standalone.js.map

请检查此 JS 文件中的 URL 引用,特别是任何 相对路径可能指向错误的位置。 enter image description here

最佳答案

我已经找出这个错误的原因了。我正在使用 Django==4.0,我必须将其降级到 Django==3.2.9,错误就消失了。

关于django - Whitenoise.storage.MissingFileError : The JS file 'drf-yasg\redoc\redoc.min.js' references a file which could not be found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70289038/

相关文章:

python - DRF 更改自定义操作的默认 View 集的lookup_field

python - 如何使用 drf-yasg 自动生成的 swagger 页面配置 "HTTPS"方案?

django - 属性错误: '__proxy__' object has no attribute 'set_attributes_from_name' when using ArrayField in Django

python - Django 身份验证和权限 : Snippets visible only to the creator

Docker 容器内的 Django + uWSGI/nginx - ImportError : No module named . wsgi

python - 如何修复 'TypeError: __init__() got an unexpected keyword argument ' 发件人”

django - docker : compose file is incompatible with Amazon ECS

django - Django ElasticSearch DSL DRF聚合

django - Swagger Django [规范中未定义操作]