The file 'cms/css/cms.base.css' could not be found with CompressedManifestStaticFilesStorage
See original GitHub issueI am stuck with this issues since yesterday, and cannot find a solution.
I use django-cookiecutter and integrated my django-cms app. Everything works fine, except when I open pages that have django-cms CSS. I get the following error:
ValueError: The file 'cms/css/cms.base.css' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7f238b1fa610>.
File "django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "django/core/handlers/base.py", line 217, in _get_response
response = self.process_exception_by_middleware(e, request)
File "django/core/handlers/base.py", line 215, in _get_response
response = response.render()
File "django/template/response.py", line 109, in render
self.content = self.rendered_content
File "django/template/response.py", line 86, in rendered_content
content = template.render(context, self._request)
File "django/template/backends/django.py", line 66, in render
return self.template.render(context)
File "opbeat/instrumentation/packages/base.py", line 63, in __call__
args, kwargs)
File "opbeat/instrumentation/packages/base.py", line 222, in call_if_sampling
return self.call(module, method, wrapped, instance, args, kwargs)
File "opbeat/instrumentation/packages/django/template.py", line 18, in call
return wrapped(*args, **kwargs)
File "django/template/base.py", line 208, in render
return self._render(context)
File "django/template/base.py", line 199, in _render
return self.nodelist.render(context)
File "django/template/base.py", line 994, in render
bit = node.render_annotated(context)
File "django/template/base.py", line 961, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 174, in render
return compiled_parent._render(context)
File "django/template/base.py", line 199, in _render
return self.nodelist.render(context)
File "django/template/base.py", line 994, in render
bit = node.render_annotated(context)
File "django/template/base.py", line 961, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 174, in render
return compiled_parent._render(context)
File "django/template/base.py", line 199, in _render
return self.nodelist.render(context)
File "django/template/base.py", line 994, in render
bit = node.render_annotated(context)
File "django/template/base.py", line 961, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 174, in render
return compiled_parent._render(context)
File "django/template/base.py", line 199, in _render
return self.nodelist.render(context)
File "django/template/base.py", line 994, in render
bit = node.render_annotated(context)
File "django/template/base.py", line 961, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 70, in render
result = block.nodelist.render(context)
File "django/template/base.py", line 994, in render
bit = node.render_annotated(context)
File "django/template/base.py", line 961, in render_annotated
return self.render(context)
File "django/templatetags/static.py", line 104, in render
url = self.url(context)
File "cms/templatetags/cms_static.py", line 31, in url
url = super(StaticWithVersionNode, self).url(context)
File "django/templatetags/static.py", line 101, in url
return self.handle_simple(path)
File "django/templatetags/static.py", line 114, in handle_simple
return staticfiles_storage.url(path)
File "django/contrib/staticfiles/storage.py", line 132, in url
hashed_name = self.stored_name(clean_name)
File "django/contrib/staticfiles/storage.py", line 292, in stored_name
cache_name = self.clean_name(self.hashed_name(name))
File "django/contrib/staticfiles/storage.py", line 95, in hashed_name
(clean_name, self))
Colelctstatic correctly copied the file and whitenoise even Post-processed
the file:
django_1 | Copying '/usr/local/lib/python2.7/site-packages/cms/static/cms/css/3.4.1/cms.base.css'
django_1 | Post-processed 'cms/css/3.4.1/cms.base.css' as 'cms/css/3.4.1/cms.base.1784b3b6c6ab.css'
Here are some settings, where I believe they might have an impact:
MIDDLEWARE = (
'django.middleware.security.SecurityMiddleware',
'cms.middleware.utils.ApphookReloadMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware',
# Your stuff goes here (save in config.middlewares)
'config.middlewares.RequireLoginMiddleware',
)
# STATIC FILE CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
STATIC_ROOT = str(ROOT_DIR('staticfiles'))
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
STATIC_URL = '/static/'
# See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS
STATICFILES_DIRS = (
str(APPS_DIR.path('static')),
)
WHITENOISE_MIDDLEWARE = ('whitenoise.middleware.WhiteNoiseMiddleware', )
MIDDLEWARE = WHITENOISE_MIDDLEWARE + MIDDLEWARE
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
Anyone any idea? Any other info you need?
Issue Analytics
- State:
- Created 7 years ago
- Comments:28 (10 by maintainers)
Top Results From Across the Web
The file 'cms/css/cms.base.css' could not be found ... - GitHub
I am stuck with this issues since yesterday, and cannot find a solution. I use django-cookiecutter and integrated my django-cms app.
Read more >The file 'css/style.css' could not be found with whitenoise ...
I am trying to deploy an app using heroku. But for some reason, the static files are not loaded with whitenoise and there...
Read more >rest_framework/css/bootstrap.min.css.map : r/django - Reddit
The CSS file 'rest_framework/css/bootstrap.min.css' references a file which could not be found: rest_framework/css/bootstrap.min.css.map.
Read more >Solving the React Error: Not Picking Up CSS Style | Pluralsight
In this guide, you will learn about the errors that can occur while importing a CSS file into your React file.
Read more >Theme is missing the style.css stylesheet error
A common issue that can occur when installing a WordPress themes is “The package could not be installed. The theme is missing the......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Jafnee we are planning in about a week or two, depending on the results from testing and the help from the community.
Until this is fixed I’m using a custom
ManifestStaticFilesStorage
:Use in
settings.py
like this:This will exclude all static files paths starting with “cms/”. Because django-cms static file paths contain a version number, cache busting across versions should still work. Depends on
Django==1.10
.