Fixing Python and Django ValueError: Missing staticfiles manifest entry for ‘favicon.ico’

Python and Django ValueError: Missing staticfiles manifest entry for ‘favicon.ico’ is an error which occurs when python cannot find the entry of ‘favicon.ico’.

In the blog post I attempt to explain why this error takes place and how you can solve it, I will also add other solutions that could solve the error if possible.

Exploring Python and Django ValueError: Missing staticfiles manifest entry for ‘favicon.ico’

This is an error which occurs when python cannot find the entry of ‘favicon.ico’.

I will explain why this error takes place and how to fix it, while also trying to add other solutions that could solve the error.

                                                                       #
ValueError: Missing staticfiles manifest entry for 'favicon.ico'
                                                                       #

To solve the problem above, I have 2 solutions which worked for me, bellow is a detailed explanation of both.

Solution 1 : Pay attention to the “/” before the path/ to your URLs

The message of the error is self explanatory, understanding it is easy, but finding the root of the error can be very challenging.

This is one of those errors that might happen for many different reasons.

One of those reasons is including the leading “/” in some of your URLs, static URLs that is. For example.

                                                                       #
{% static '/path/.../.../file' %}
                                                                       #

You see, that little “/” before path/

That should be removed. This ‘/path/…/…/file’ should become this ‘path/…/…/file’

Try this and if it works perform a celebration dance or donate to my Kofi account.

Solution 2 : use @override_settings() in order to override the settings of the imported class.

Another notorious cause of the error is missing the file staticfiles.json, ManifestStaticFilesStorage expects the file to exist which causes the error.

The fix is to use @override_settings() in order to override the settings of your class.

                                                                       #
from django.test import myclass, override_settings
@override_settings(STATICFILES_STORAGE='django.contrib.staticfiles.
storage.StaticFilesStorage')
class MyTest(myclass):
    pass
                                                                       #

This should solve your issue, the error should be eliminated. Please donate if you can, only if you can. Thank you.

It is worth to mention that this is one of those errors that have a plethora of causes but these two causes are the most notorious and popular.

Summing-up : 

This is the end of the article, thanks for reading our post and good luck with the scripts to come. I hope the error : Python and Django ValueError Missing staticfiles manifest entry for favicon.ico is gone. If you want to support us consider donating to our Kofi account using the red button on top of this page.

Keep coding, keep learning Python and cheers. If you want to learn more about Python, please check out the Python Documentation : https://docs.python.org/3/