Skip to content

Commit

Permalink
Update favicon for admin site. Also, because browsers will still some…
Browse files Browse the repository at this point in the history
…times request the favicon.ico even when it is not in use - add a redirect
  • Loading branch information
jmcarson committed Nov 21, 2024
1 parent 7cb7ebd commit fb24643
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.shortcuts import redirect
from django.urls import include, path
from django.views import defaults as default_views
from django.views.generic import TemplateView
Expand All @@ -26,6 +27,7 @@
"collaborative_analysis/",
include("primed.collaborative_analysis.urls", namespace="collaborative_analysis"),
),
path("favicon.ico", lambda _: redirect("static/images/favicons/primed-favicon.png", permanent=True)),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


Expand Down
7 changes: 7 additions & 0 deletions primed/templates/admin/base_site.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "admin/base_site.html" %}
{% load static %}
{% block extrahead %}

<link rel="shortcut icon" href="{% static 'images/favicons/primed-favicon.png' %}">

{% endblock %}

0 comments on commit fb24643

Please sign in to comment.