0

I am unable to run python manage.py collectstatic with Django 4.0. Error is

....min.js references a file which could not be found .....min.js.map

I believe this is due to Django 4.0 collectstatic having added manifest_storage: https://docs.djangoproject.com/en/4.0/ref/contrib/staticfiles/

This leads to error. I try to disable this by

WHITENOISE_MANIFEST_STRICT = False

but this does not have any affect. I run site on Heroku so I have

django_heroku.settings(locals()) 

at end of settings.py file.

Tried to fix this by adding an empty file with touch to location indicated in error message. Error is gone, but next .map-file is missing. No sense to manually fix.

The question - how to disable finding .map -files in manage.py collectstatic in Heroku-setup?

  • My solution was to add after django_heroku.settings(locals()) if DEBUG is True: STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' based on recommendation given in:https://docs.djangoproject.com/en/4.0/ref/contrib/staticfiles/#django.contrib.staticfiles.storage.ManifestStaticFilesStorage During testing, ensure that the STATICFILES_STORAGE setting is set to something else like 'django.contrib.staticfiles.storage.StaticFilesStorage' (the default). – Heikki Tukiainen Dec 23 '21 at 10:16

0 Answers0