[Answered ]-Django serving static files/ angularJS app

2👍

using django whitenoise and setting the WHITENOISE_ROOT path to my static files worked for me.

👤icam0

0👍

You own answer was helpful but I found I had to include WHITENOISE_INDEX_FILE = True to my settings.py to get it to work – what I ended up using:

STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')#typical usage from docs
STATIC_ROOT = os.path.join(BASE_DIR, 'static')#this in both your/my case
STATIC_URL = '/static/'
WHITENOISE_ROOT = os.path.join(BASE_DIR, 'static')#same as static_root
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
WHITENOISE_INDEX_FILE = True

Leave a comment