Issue
Static files load when DEBUG=True
(locally and at the dev server), but not when DEBUG=False
(production).
STATICFILES_DIRS
is set to my dist
dir created by Vue, and dist
is not in the .gitignore
. Heroku runs collectstatic on every deploy by default (I have not changed this).
The actual error is a 404 when trying to load any static file. The whitenoise
package is being used. I've updated the middleware settings, and wsgi.py
according to the docs, and have the settings variable which enables compression via whitenoise
set (also according to the whitenoise
docs).
whitenoise
usually works fine with other apps. I'm not sure what's wrong with this. The difference is that I'm using Vue for the first time. I'd never used a js framework before.
When setting DEBUG=False
locally, staticfiles still load fine, so I am unable to debug in that way.
Can anyone help?
Solution
django-heroku was the problem. In my settings I was using django-heroku. Removing it got staticfiles to load at production.
Answered By - Mike Johnson Jr
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.