django-spa icon indicating copy to clipboard operation
django-spa copied to clipboard

Loading Django Admin's assets partially

Open beltekylevi opened this issue 5 years ago • 0 comments

  • 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].css was 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_STORAGE because 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.

beltekylevi avatar May 08 '20 10:05 beltekylevi