question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing staticfiles manifest entry for 'django_summernote/summernote.css'

See original GitHub issue

I got this error when using STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage' ValueError: Missing staticfiles manifest entry for 'django_summernote/summernote.css' I’m not sure if it relates to #170

DEBUG = False Django==1.11.4 django-summernote==0.8.8.2

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
pincoincommented, Oct 29, 2017

@tamhv

I also made DjsManifestStaticFilesStorage which extends ManifestStaticFilesStorage.

class DjsManifestStaticFilesStorage(ManifestStaticFilesStorage):
    manifest_strict = False

I also encountered the same error. I solved the problem by overriding hashed_name method.

import os

from django.contrib.staticfiles.storage import ManifestStaticFilesStorage
from django.utils.six.moves.urllib.parse import (
    unquote, urlsplit, urlunsplit,
)


class DjsManifestStaticFilesStorage(ManifestStaticFilesStorage):
    manifest_strict = False

    def hashed_name(self, name, content=None, filename=None):
        # `filename` is the name of file to hash if `content` isn't given.
        # `name` is the base name to construct the new hashed filename from.
        parsed_name = urlsplit(unquote(name))
        clean_name = parsed_name.path.strip()
        if filename:
            filename = urlsplit(unquote(filename)).path.strip()
        filename = filename or clean_name
        opened = False
        if content is None:
            try:
                content = self.open(filename)
            except IOError:
                # Handle directory paths and fragments
                return name
            opened = True
        try:
            file_hash = self.file_hash(clean_name, content)
        finally:
            if opened:
                content.close()
        path, filename = os.path.split(clean_name)
        root, ext = os.path.splitext(filename)
        if file_hash is not None:
            file_hash = ".%s" % file_hash
        hashed_name = os.path.join(path, "%s%s%s" %
                                   (root, file_hash, ext))
        unparsed_name = list(parsed_name)
        unparsed_name[2] = hashed_name
        # Special casing for a @font-face hack, like url(myfont.eot?#iefix")
        # http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax
        if '?#' in name and not unparsed_name[3]:
            unparsed_name[2] += '?'
        return urlunsplit(unparsed_name)

I just removed the code which checks file exist. It seems to work, but I am not sure if it’s correct. I have to study more in detail. That’s why I told you that I would provide the code as soon as possible.

I also want your feedback. Thank you.

0reactions
pincoincommented, Oct 29, 2017

@tamhv

Thank you for your response. We will close this issue at this point.

I also wonder if there’s a side-effect on that change. If you encounter another problem, feel free to tell us. And, we will talk again after opening the new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ValueError: Missing staticfiles manifest entry for 'favicon.ico'
If a file isn't found in the staticfiles.json manifest at runtime, a ValueError is raised. This behavior can be disabled by subclassing ...
Read more >
ValueError: Missing staticfiles manifest entry for ... - GitHub
When using S3ManifestStaticStorage, even with manifest_strict = False, I continue to get ValueError: Missing staticfiles manifest entry for ...
Read more >
Static Files in Django - Dan's Cheat Sheets's documentation!
Managing static files in Django seems to be one of the most confusing ... What if you get the error “ValueError: Missing staticfiles...
Read more >
raise ValueError("Missing staticfiles manifest entry for '%s ...
When I set Debug = True in my settings.py, it will load just fine but exposes variables and such when there are errors...
Read more >
ValueError: Missing staticfiles manifest entry for 'favicon.ico'
Django : ValueError: Missing staticfiles manifest entry for 'favicon.ico' [ Beautify Your Computer ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found