[Fixed]-Python manage.py collectstatic error: cannot find rest_framework bootstrap.min.css.map (from book 'Django for APIs')

25👍

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:

static/rest_framework/css/bootstrap-theme.min.css.map
static/rest_framework/css/bootstrap.min.css.map

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.

0👍

You have STATIC_ROOT pointing to BASE_DIR / "staticfiles" and then STATIC_URL = "static/". Make them point to the same static folder like this.

STATIC_URL = '/static/'
STATIC_DIR = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = [

    os.path.join(BASE_DIR, "static")
]

Leave a comment