Serve /favicon.ico resembling current arachnys/img/icon_*x*.png files

One of the effects is that you don't get this Django error e-mail any more:
> ```
> [Django] ERROR: "GET /favicon.ico HTTP/1.0" 500 106
> ```

`.ico` was auto-created as following:
```
$ ( cd cabot/static/arachnys/img && convert icon_*x*.png favicon.ico && file favicon.ico )
favicon.ico: MS Windows icon resource - 2 icons, 48x48, 32 bits/pixel, 96x96, 32 bits/pixel
```
This commit is contained in:
Sebastian Pipping 2018-04-21 21:29:04 +02:00
parent 2c8bb9d9af
commit 6e063824d3
2 changed files with 5 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@ -25,12 +25,14 @@ from rest_framework.documentation import include_docs_urls
from django.contrib import admin
from django.views.generic.base import RedirectView
from django.views.static import serve
from django.shortcuts import redirect
from django.contrib.auth.views import login, logout, password_reset, password_reset_done, password_reset_confirm
admin.autodiscover()
from importlib import import_module
import logging
import os
logger = logging.getLogger(__name__)
@ -55,6 +57,9 @@ urlpatterns = [
# for the password reset views
url('^', include('django.contrib.auth.urls')),
url(r'^(?P<path>favicon\.ico)$', serve, name='favicon',
kwargs={'document_root': os.path.join(settings.STATIC_ROOT, 'arachnys/img')}),
url(r'^$', view=home_authentication_switcher,
name='dashboard'),
url(r'^subscriptions/', view=subscriptions,