为什么在不激活 WhiteNoise 的情况下在 Heroku 上提供静态文件?

Why static files are served on Heroku without activating WhiteNoise?

我遵循了有关在 Heroku 服务器上部署 Django 应用程序的教程,但我偶然发现了这个:

MIDDLEWARE = [
    'whitenoise.middleware.WhiteNoiseMiddleware',
]

但是省略了wsgi.py文件中激活它:

from whitenoise import WhiteNoise
from my_project import MyWSGIApp
    application = MyWSGIApp()
    application = WhiteNoise(application, root='/path/to/static/files')
    application.add_files('/path/to/more/static/files', prefix='more-files/')

为什么在生产站点上提供静态文件?上面的代码不应该对此负责吗?

wsgi.py 集成在 v4.0 中 required since v3.0 and was removed