Skip to content

Commit

Permalink
Add redirectview for favicon.ico to our custom favicon. Make redirect…
Browse files Browse the repository at this point in the history
… view not login protected
  • Loading branch information
jmcarson committed Nov 21, 2024
1 parent 522554d commit 777a730
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@
"socialaccount_signup",
"admin:index",
"admin:login",
"favicon"
]

# django-dbbackup
Expand Down
3 changes: 3 additions & 0 deletions config/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from django.conf import settings
from django.conf.urls.static import static
from django.templatetags.static import static as static_url_tag
from django.contrib import admin
from django.urls import include, path
from django.views import defaults as default_views
from django.views.generic import TemplateView
from django.views.generic.base import RedirectView

urlpatterns = [
path("", TemplateView.as_view(template_name="pages/home.html"), name="home"),
Expand All @@ -22,6 +24,7 @@
"gregor_anvil/",
include("gregor_django.gregor_anvil.urls", namespace="gregor_anvil"),
),
path("favicon.ico", RedirectView.as_view(url=static_url_tag("images/favicons/favicon_1.jpg"), permanent=True), name="favicon"),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


Expand Down

0 comments on commit 777a730

Please sign in to comment.