shabeer90
shabeer90

Reputation: 5151

Django ERROR (EXTERNAL IP): Internal Server Error: /ico/apple-touch-icon-precomposed.png

My django application is currently sending error reports when users try to acces pages of the site that does nor exist, which is how its supposed to be.

But when I try to use the django application though my tablets(Android and Apple) I get an email with this error

[Django] ERROR (EXTERNAL IP): Internal Server Error: /ico/apple-touch-icon-precomposed.png

My html header looks like this

{% load static %}
<link rel="icon" href="{% static 'favicon.ico' %}" type="x-icon" />

My static file path just in case.

|-- static
    |-- css
    |-- img
    |-- js
    |-- ico
        |-- favicon.png
        |-- apple-touch-icon-precomposed.png
    |-- favicon.ico

I did some googleing and found this regarding error reporting and tried adding the following to the settings.py but had no luck.

import re
IGNORABLE_404_URLS = (
    re.compile(r'^/ico/apple-touch-icon-precomposed\.png$'),
    re.compile(r'^/favicon\.ico$'),
    re.compile(r'^/robots\.txt$'),
)

How can I fix this to avoid getting emails about the Server Error on the favicons.

Does anyone have an idea on this? Have I missed out on anything

Thanks in advance for the help

Upvotes: 1

Views: 1701

Answers (2)

Jigar Patel
Jigar Patel

Reputation: 1

I think apple devices make those requests if the device owner adds the site to it.

This is the equivalent of the favicon. To resolve, add 2 100×100 png files, save it as apple-touch-icon-precomposed.png and apple-touch-icon.png and upload it to the root directory of the server.

For me the error has gone.

Upvotes: 0

shabeer90
shabeer90

Reputation: 5151

It might be funny but this is how I solved my problem.

I added the extra few bit into my header. Make sure to load the smallest image first, for more regarding this you can read here

{% load static %}
<link rel="icon" href="{% static 'favicon.ico' %}" type="x-icon" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="{% static 'ico/apple-touch-icon-72-precomposed.png' %}" type="image/png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="{% static 'ico/apple-touch-icon-114-precomposed.png' %}" type="image/png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{% static 'ico/apple-touch-icon-144-precomposed.png' %}" type="image/png">
<link rel="icon" href="{% static 'ico/favicon.png' %}" type="image/png"> 

And finally I added the extra images into static

|-- static
    |-- css
    |-- img
    |-- js
    |-- ico
        |-- favicon.png
        |-- apple-touch-icon-precomposed.png
        |-- apple-touch-icon-72x72-precomposed.png
        |-- apple-touch-icon-114x114-precomposed.png
        |-- apple-touch-icon-144x144-precomposed.png
    |-- favicon.ico

Hope this is usefull to someone out there.

Upvotes: 1

Related Questions