cristian
cristian

Reputation: 526

Why static files are served on Heroku without activating WhiteNoise?

I followed a tutorial on deploying Django app on Heroku server and I stumble across this:

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

But omitted to activate it inside wsgi.py file:

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/')

Why the static files are served on the production site ? Should not the above code be responsible for this ?

Upvotes: 0

Views: 73

Answers (1)

D. Evans
D. Evans

Reputation: 3292

The wsgi.py integration hasn't been required since v3.0 and was removed in v4.0.

Upvotes: 1

Related Questions