Skip to content
Advertisement

python manage.py collectstatic error: cannot find rest_framework bootstrap.min.css.map (from book ‘Django for APIs’)

I am reading the book ‘Django for APIs’ from ‘William S. Vincent’ (current edition for Django 4.0)

In chapter 4, I cannot run successfully the command python manage.py collectstatic.

I get the following error:

JavaScript

I have the exact same settings like in the book in settings.py:

JavaScript

I couldn’t find any explanation for it. maybe someone can point me in the right direction.

Advertisement

Answer

Update: DRF 3.14.0 now supports Django 4.1. If you’ve added stubs to static as per below, be sure to remove them.

This appears to be related to Django 4.1: either downgrade to Django 4.0 or simply create the following empty files in one of your static directories:

JavaScript

There’s a recent change to ManifestStaticFilesStorage where it now attempts to replace source maps with their hashed counterparts.

Django REST framework has only recently added the bootstrap css source maps but is not yet released.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement