Actually use (some) favicon

This commit is contained in:
Klaas van Schelven
2023-11-05 22:59:29 +01:00
parent 1d732d8c3c
commit e4e10cbd3d
12 changed files with 20 additions and 1 deletions

BIN
assets/bigbug-32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
assets/bigbug-64-64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
assets/blue-32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
assets/blue-64x64.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
assets/yello-64x64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
assets/yellow-32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
bugsink/.urls.py.swo Normal file

Binary file not shown.

View File

@@ -113,6 +113,9 @@ USE_TZ = True
# https://docs.djangoproject.com/en/4.2/howto/static-files/
STATIC_URL = 'static/'
STATICFILES_DIRS = [
BASE_DIR / "static",
]
# Default primary key field type
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field

View File

@@ -3,7 +3,7 @@ from django.conf import settings
from django.contrib import admin
from django.urls import include, path
from .views import trigger_error
from .views import trigger_error, favicon
urlpatterns = [
@@ -13,6 +13,8 @@ urlpatterns = [
path('issues/', include('issues.urls')),
path('admin/', admin.site.urls),
path("favicon.ico", favicon),
]
if settings.DEBUG:

View File

@@ -1,2 +1,16 @@
from django.conf import settings
from django.views.decorators.http import require_GET
from django.views.decorators.cache import cache_control
from django.http import FileResponse, HttpRequest, HttpResponse
def trigger_error(request):
raise Exception("Exception triggered on purpose to debug error handling")
@require_GET
@cache_control(max_age=60 * 60 * 24, immutable=True, public=True)
def favicon(request: HttpRequest) -> HttpResponse:
file = (settings.BASE_DIR / "static" / "favicon.png").open("rb")
return FileResponse(file)

BIN
static/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB