Monday 23 November 2020

PythonAnywhere Internal Server Error ager '/favicon.ico' call added.

 After adding my Favicon pack to the Static files in PythonAnywhere ( using the 'Files' link; and then adding the files in mysite/static folder ) 
And then when accessing the site the next time I was seeing the following message on the homepage. 


Internal Server Error


On checking the error.log ( go to > Webb > Scroll down to 'Error.log' ) 
I could see the message ' Internal Server Error: /favicon.ico' 


So my next port of call was to check that the favicon.ico could be seen at the same URL ( relatively ) as the one that I have working on my local server.  It was working though, so no issue there. 


So my next port of call was to check that the favicon.ico could be seen at the same URL ( relatively ) as the one that I have working on my local server.  It was working though, so no issue there. 

After revisiting the issue I realised it was the message above the 'Internal Server Error' that was most useful . 


raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name)

ValueError: Missing staticfiles manifest entry for 'images/favicon.ico'

2020-11-23 14:39:05,951: Internal Server Error: /favicon.ico


Missing staticfiles manifest entry in Django issue


Which led me to adding the following change which worked. 

OPEN 
/mysite/settings/base.py

FIND

STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'


and changed this to . 

STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'



It might not be recommended but for the small site I'm working on this fix will be fine.  And felt it's worth noting for anyone else who stumbles over the same issue. 

No comments: