django-spa
django-spa copied to clipboard
Loading Django Admin's assets partially
- django-spa version: 0.3.5
- Django version: 2.1.7
- Python version: 3.7.6
- Operating System: macOS / Ubuntu 18.04 (Heroku-18)
Description
Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen.
I have a Django application in which I'd like to serve my SPA, bootstrapped with Create React App. In production the application is served by daphne. (version 2.2.5)
I followed the guide provided and the SPA is served well but in Django Admin I noticed that the assets are not loading properly. Most noticeably, missing icons and fonts.
I did not experience any missing resources. All resources were properly loaded.
What I Did
- Looked into what is served and I noticed that
/static/admin/css/base.[hash].csswas missing the icons - Did the installation process step-by-step and checked when this weird behaviour starts
- Figured out that it has to do something with the
STATICFILES_STORAGEbecause when I change it from'spa.storage.SPAStaticFilesStorage'to'whitenoise.storage.CompressedManifestStaticFilesStorage'the admin assets were loaded
python manage.py collectstatic --clear --noinput
daphne -b 0.0.0.0 -p 1234 boshi.asgi:application
Let me know if I can help.