Reputation: 526
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